Skip stale entries in the DSL shared library list - #3484
Open
VaggelisGian wants to merge 1 commit into
Open
Conversation
get_shared_libs raised FileNotFoundError on the first missing entry of
the colon-separated {prefix}_LIBS list. The list travels inside job
environments (Slurm sbatch defaults to --export=ALL), so a worker could
receive an entry pointing into the submitter's site-packages and every
compile died on it even though another entry named a usable local
runtime.
Skip entries whose file does not exist on this machine and warn about
them instead. Keep raising when nothing in the list survives, since
that means there is no usable runtime at all and the compile cannot
proceed.
Add test/python/CuTeDSL/test_shared_libs.py covering the mixed,
all-missing and unset cases.
Test Plan:
docker python:3.12-slim, editable install of python/CuTeDSL:
CUTE_DSL_LIBS=<stale>:<valid cu12/lib/libcute_dsl_runtime.so>
unfixed: FileNotFoundError: /nonexistent/libcute_dsl_runtime.so
fixed: warning + COMPILE_OK
CUTE_DSL_LIBS=<stale1>:<stale2>
fixed: FileNotFoundError naming the full list
python test/python/CuTeDSL/test_shared_libs.py -v:
Ran 3 tests ... OK (skip test fails on unfixed code)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3462 (part 2: worker-side hard failure)
get_shared_libsraisedFileNotFoundErroron the first missing entry of the colon-separated{prefix}_LIBSlist. The list travels inside job environments (Slurmsbatchdefaults to--export=ALL), so a worker can receive an entry pointing into the submitter's site-packages, and every compile died on it even though another entry named a usable local runtime.This skips entries whose file does not exist on this machine and warns about them instead. It keeps raising when nothing in the list survives, since that means there is no usable runtime at all and the compile cannot proceed.
Part 1 of the issue (the import-time
CUTE_DSL_LIBSmutation that manufactures these stale entries) is a separate mechanism in a separate file and is intentionally not bundled here.Adds
test/python/CuTeDSL/test_shared_libs.py(3 CPU-only tests using a stubbed DSL instance).Test Plan:
Known same-class gaps left out of scope:
cutlass/jax/ffi.py::find_cute_dsl_runtime_libraryandtvm_ffi_provider.pystill return the first name-matching entry without an existence check.