Skip to content

NF12 legacy namespace fallback is blocked by new row-major loader requirements #3886

Closed

Description

@Qubitium

Reproduction (current main, daa5dae)

python -m pytest -q tests/test_gptqmodel_nf12_api.py::test_repeat4_uses_single_copy_from_preloaded_legacy_namespace fails on a CUDA host without nvcc with gptqmodel_nf12._jit._MissingBuildTools. The test preloads an older torch.ops.nf12 namespace containing embedding but not the newer row-major operators.

embedding_repeat4 explicitly documents and implements a fallback to single-copy embedding when a legacy library lacks embedding_repeat4. But it calls load() first. _library.load() now requires rowmajor_pack and rowmajor_embedding before recognizing a preloaded namespace. A legacy namespace with a usable embedding op is therefore rejected, and the loader tries to JIT/load another NF12 library. Without build tools it raises before the fallback; with another library already registered, a second TORCH_LIBRARY load risks a registration error.

Expected

Allow embedding_repeat4 to use the already-registered single-copy operator without requiring unrelated newer row-major ops. Keep the preloaded legacy-namespace test passing and add compatibility checks for partial operator sets where individual API calls can still work. This is separate from the no-extension embedding cast failure in #3860.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions