@ninjin Two suggestions for the notebook template: maybe use Julia 1.1 or 1.2, since 1.0 has a bug that displays a nasty (but harmless) stacktrace when importing CuArrays. You also should do @benchmark CuArrays.@sync ... or you’re just measuring kernel launch time.
@maleadt Duly noted, I had wondered for some time why that scary stacktrace showed up from time to time, yet had no effect on the actual usage of CuArrays. While I have updated the benchmarking code, I will stick to 1.0 for now as the class is in full swing.
I tried solving the problem the problem for the Julia in Google Collab.The Julia 1.3.1 notebook works completely fine with GPU functionality.The notebook contains step by step information for the execution of code.
visit this repository:
I tried what you mentioned in the repository, and got stuck after the first step. I am not able to find any options which can change the runtime type (Initially, I used to see Python 2 and Python 3 as options). The option for Julia 1.x is not shown in Notebook settings (I remember the option existing before). I only see the option which lets me change the accelerator (None, GPU, TPU). Can you tell if there is any other method to shift to Julia in this step? I think Colab has stopped giving us options to change runtime type, and has started using Python 3 by default.
This kind of error can occurr when you try to just copy the contents of the first cell into another notebook and run it.This notebook is a template to work on.
Try using the notebook in the repository directly.
I created a Colab notebook template, inspired by the notebooks above, but which supports easily setting the version of Julia (any version since 0.7.0 up to the latest version), and changing the list of Julia packages to be installed.
Please add the package Plots to your colab notebook template by default
Please make it clear to the user that “Reload this page and continue to the next section.” means press the RELOAD button on your webbrowser. I spent too much time looking for the option to reload the page on the google website
Inform your user that to write new julia code on colab notebook, they first need to click on the “+ Code” button on the top of the page and then look for the new code section to add in the julia code. Not every newbie is familiar with Google colab notebook
Inform the user, that they need to have a google account, to use google drive. The easiest way is to set up a gmail account even if they do not use gmail.
By the way, I appreciate the work you have done to get julia to work with colab
Thanks all for this hack. I manage to run Julia on Google Colab. However, I cannot find a way to mount Google Drive to use with Julia (on Google Colab). I tried using PyCall like this:
googleDrive = pyimport("google.colab.drive")
but it gives the following error:
Go to this URL in a browser: https://accounts.google.com/o/oauth2/auth?client_id=947318989803-6bn6qk8qdgf4n4g3pfee6491hc0brc4i.apps.googleusercontent.com&redirect_uri=urn%3aietf%3awg%3aoauth%3a2.0%3aoob&scope=email%20https%3a%2f%2fwww.googleapis.com%2fauth%2fdocs.test%20https%3a%2f%2fwww.googleapis.com%2fauth%2fdrive%20https%3a%2f%2fwww.googleapis.com%2fauth%2fdrive.photos.readonly%20https%3a%2f%2fwww.googleapis.com%2fauth%2fpeopleapi.readonly%20https%3a%2f%2fwww.googleapis.com%2fauth%2fdrive.activity.readonly%20https%3a%2f%2fwww.googleapis.com%2fauth%2fexperimentsandconfigs%20https%3a%2f%2fwww.googleapis.com%2fauth%2fphotos.native&response_type=code
Enter your authorization code:
PyError ($(Expr(:escape, :(ccall(#= /root/.julia/packages/PyCall/BD546/src/pyfncall.jl:43 =# @pysym(:PyObject_Call), PyPtr, (PyPtr, PyPtr, PyPtr), o, pyargsptr, kw))))) <class 'EOFError'>
EOFError('EOF when reading a line')
File "/usr/local/lib/python3.7/dist-packages/google/colab/drive.py", line 260, in mount
fifo_file.write(get_code(auth_prompt) + '\n')
Switching the runtime type to “Python” to mount Google Drive will just get rid of the “julia” runtime of the notebook.
@JohnnyChen94 is your repo for installing Julia on Colab working fine with Julia v1.6.2? I never used Colab before but apparently I can’t load any package after Julia is installed and the package is installed with Pkg.jl. For example, doing a simple Pkg.add("CSV") will install an old version of CSV.jl. I then force the installation of the latest version with Pkg.add(name="CSV", version="0.8.5") but when I try to using CSV in another cell I get load errors.
Any help is appreciated as we are doing a workshop this week and participants with less-powerful machines need a Colab instance to contribute more efficiently.
For example, doing a simple Pkg.add("CSV") will install an old version of CSV.jl. I then force the installation of the latest version with Pkg.add(name="CSV", version="0.8.5") but when I try to using CSV in another cell I get load errors.
The only dependency that the notebook requires is IJulia, so if there are some version conflicts with IJulia, then this could happen. But I guess a refresh of the notebook page Ctrl-R or restarting kernels could resolve the issues.
For this very specific case and time point, I believe it’s because CSV hasn’t yet released a version compatible with Parsers@2; CSV@0.8.5 is compatible with Parsers@1 only