Skip to content

Instantly share code, notes, and snippets.

View georgevreilly's full-sized avatar

George V. Reilly georgevreilly

View GitHub Profile
@georgevreilly
georgevreilly / cuda-deps-cannot-be-preloaded-under-bazel.md
Created January 12, 2024 12:48
CUDA deps cannot be preloaded under Bazel

CUDA deps cannot be preloaded under Bazel

🐛 Describe the bug

If Torch 2.1.0 is used as a dependency with Bazel and rules_python, _preload_cuda_deps fails with OSError: libcufft.so.11: cannot open shared object file: No such file or directory.

Torch 2.1 works fine if you install it and its CUDA dependencies into a single site-packages (e.g., in a virtualenv). It doesn't work with Bazel, as it installs each dependency into its own directory tree, which is appended to PYTHONPATH.

$ bazel test //...
@georgevreilly
georgevreilly / vowels.md
Created February 12, 2024 10:26
Alphabetical vowels found in /usr/share/dict/words on macOS Sonoma 14.2.1

Words with all five vowels in forward and backward order

Using /usr/share/dict/words on macOS Sonoma 14.2.1

Forward order, aeiou

180 results

$ grep -i '.*a.*e.*i.*o.*u.*' /usr/share/dict/words
@georgevreilly
georgevreilly / deterministic_shuffle.py
Last active October 27, 2024 07:27
Stable shuffle of a sequence
#!/usr/bin/env python3
from __future__ import annotations
import argparse
import random
from functools import reduce
from typing import Any
@georgevreilly
georgevreilly / deps_topo.py
Created December 20, 2024 22:39
Compute topological dependency graphs for a shared library. See https://www.georgevreilly.com/blog/2024/12/16/PatchingAndSplittingPythonWheels.html
#!/usr/bin/env python3
"""
Produce topological sorted graphs of shared object library dependencies.
"""
from __future__ import annotations
import json
import os