Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Colab update breaks compatibility with JuliaLang #3385

Closed
MilesCranmer opened this issue Feb 2, 2023 · 6 comments
Closed

Colab update breaks compatibility with JuliaLang #3385

MilesCranmer opened this issue Feb 2, 2023 · 6 comments
Labels

Comments

@MilesCranmer
Copy link

MilesCranmer commented Feb 2, 2023

Dear Colab team,

I am have enjoyed using colab as a pro subscriber for several years now — both as an education tool for my students, as well as for research. I also loved using it for internal development when I worked at DeepMind.

I would like to report an issue that the latest update to the VM used by Google Colab appears to break all compatibility with JuliaLang, over all versions of Julia that I have tested, and on both CPU and GPU runtimes. This includes Python libraries which use Julia as a dependency.

Background

Julia can both be used in Colab a dependency of various Python libraries, as well as through PyJulia, as well as used directly by replacing the default Jupyter kernel (e.g., @ageron's julia examples). (Some interesting trivia: Jupyter actually stands for Ju(lia)pyt(hon)e(R) - the three languages initially supported by Jupyter.)

Now of course I understand that only Python is officially supported, but regardless, Julia has very large numerical computing ecosystem with many libraries of interest to both colab subscribers and Google Cloud clients in general, and is a dependency of several Python libraries. For the past several years it has been possible to install Julia on any Colab runtime without issue – useful for research and education. (A nice example of this is the examples for AlphaZero.jl — which are now unfortunately broken).

For example, tomorrow I am teaching a symbolic ML tutorial at MIT to nearly 100 ugrad/grad students, and while I had planned to use Colab (which, from Google's perspective, would probably be a great way to increase academic interest in Google Cloud!), I had to switch last-minute to using an inferior alternative instead, because colab is now generating errors (MilesCranmer/PySR#259).

MWE

Launching a Julia binary installed from any channel ("jill", "juliaup", or simply a tarball) seems to result in errors related to shared library incompatibility. Even the one accessible via apt-get install julia seems to result in such errors.

I note that all of these examples used to work. It is only in the last month or so when colab updated the VM did these errors start appearing – even for older versions of Julia. I don't quite understand why it has broken, because these binaries are compatible on such a wide range of linux distributions.

Here is a MWE (colab here)

%%shell
set -x

wget -nv https://julialang-s3.julialang.org/bin/linux/x64/1.8/julia-1.8.5-linux-x86_64.tar.gz -O /tmp/julia.tar.gz
tar -xzf /tmp/julia.tar.gz -C /usr/local/ --strip-components 1
rm /tmp/julia.tar.gz

followed by

!julia -e 'println("Hello World!")'

This generates the following output:

Hello World!
munmap_chunk(): invalid pointer

signal (6): Aborted
in expression starting at none:0
gsignal at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
abort at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: 0x7fa7f1a1a26d)
unknown function (ip: 0x7fa7f1a222fb)
unknown function (ip: 0x7fa7f1a2254b)
close_unit_1 at /workspace/srcdir/gcc-12.1.0/libgfortran/io/unit.c:742
close_units at /workspace/srcdir/gcc-12.1.0/libgfortran/io/unit.c:800
unknown function (ip: 0x7fa7f1dcff6a)
unknown function (ip: 0x7fa7f19d38a6)
exit at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
main at julia (unknown line)
__libc_start_main at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: 0x401098)
Allocations: 2907 (Pool: 2895; Big: 12); GC: 0

Similar errors related to shared libraries seem reproducible in versions going back to 1.4 of Julia.

Impacted projects

Here are some related issues in projects that have been impacted:

These are just the issues I have seen, there are likely many others.

This is a major issue for many projects in the Julia ecosystem, including my own, so I'm happy to help you in any way with respect to solving this bug. Let me know what else I can do to provide insight into these bugs.

Thank you.
Best regards,
Miles

@ragman-google
Copy link

Hi Miles,

This seems to be a bug with our most recent update, like you said (I can repro).

I was able to get your example notebook to work by falling back to the previous colab version, which you can do by selecting "Use fallback runtime version" in the command palette.

If this does work, one thing to note is that this setting does not persist across sessions – the command will need to be invoked on each new session.

Can you give that a try? Thanks!


Have filed b/267545937 internally to track this.

@MilesCranmer
Copy link
Author

Hi @ragman-google,

Thanks so much for your quick response, as well as for filing this internally – very much appreciated.

Indeed the fallback runtime version seems to work as a temporary fix, thanks so much for the tip! That will be very useful for getting my various tutorial notebooks working again. Let me know if there's anything I can do to help debug this for the current version.

Thanks again!
Miles

@ragman-google
Copy link

Fantastic, glad that works for you!

Please let us know if you run into anything that still fails on the old runtime version and we can try to debug.

In the meantime, we'll look into the error and try to get it fixed! Thanks for offering to help debug, your repro notebook and detailed issue is already a great help.

I'll update this issue with any updates as we have them!

@metrizable
Copy link
Contributor

@MilesCranmer Thanks for using Colab and thanks for reporting the issue. I'm glad the fallback version worked for you, although it won't be available indefinitely.

As we continue to investigate, another work-around that you can try in the meantime is unsetting LD_PRELOAD when invoking julia:

Screenshot from 2023-02-02 09-21-28

@metrizable
Copy link
Contributor

@MilesCranmer We've released a fix and the issue should now be resolved. I just tried executing the two cells as per OP and was able to successfully install and use julia on Colab:

5izodQMKr9TWNMR

@MilesCranmer
Copy link
Author

Amazing. Great work and thanks so much for the speedy turnaround! I very much appreciate the Colab team's effort to fix this. I was also able to teach that tutorial using Colab with that initial fallback runtime tip, thanks again!

Looking forward to making cool Julia-enabled notebooks in Colab!
Best,
Miles

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants