[CuTeDSL] Fix incorrect package-data key in pyproject.toml#3145
[CuTeDSL] Fix incorrect package-data key in pyproject.toml#3145Johnsonms wants to merge 1 commit intoNVIDIA:mainfrom
Conversation
The [tool.setuptools.package-data] section referenced 'nvidia_cutlass_dsl' which does not match any package being built. The installed package name is 'cutlass' (as declared in [tool.setuptools] packages), so setuptools silently ignored the entry and never included lib/*.so files in built distributions.
|
Hi @Johnsonms, thanks for the PR and the detailed investigation! Could you confirm — did you encounter this issue specifically after upgrading from an older version (e.g., < 4.4.0) to 4.4.x+? Or did you see it on a fresh install as well? This would help us determine whether your pyproject.toml fix fully addresses the root cause, or if there's an additional packaging/cleanup issue during the upgrade path that needs to be handled separately. |
Thanks @fcbruce for checking. The issue reproduces on a fresh install — the wheel built from this repo is missing the lib/*.so files regardless of upgrade history, because setuptools silently ignores the package-data key when it doesn't match the actual package name. So the pyproject.toml fix fully addresses the root cause. An upgrade from an older version wouldn't help either, as the broken wheel would overwrite the correct files. |
|
Hi @Johnsonms, I executed your commands and I cannot reproduce this issue with a fresh install. This command installs Cutlass DSL from PyPI prebuilt wheel https://github.com/Dao-AILab/flash-attention/blob/15270e66dc88d70d08f6ba6003eb17e7307149b0/flash_attn/cute/pyproject.toml#L35 I can only reproduce this issue when upgrading Cutlass DSL from a older version(< 4.4.0). It could be related with this issue #3132 Could you please more details about your environment? For example, python version, platform(x86_64/aarch64), pip list result before installing Cutlass DSL, etc. So that it could help us understand what is the root cause of this issue. |
Summary
Fix incorrect
package-datakey inpython/CuTeDSL/pyproject.tomlthat caused missing shared libraries (lib/*.so) in built distributions, leading tocutlassbeing non-importable.Problem
The
[tool.setuptools.package-data]section inpython/CuTeDSL/pyproject.tomlused an incorrect key:This key must match the Python package name, not the PyPI distribution name. Since the installed package is
cutlass(notnvidia_cutlass_dsl), setuptools silently ignored this entry.As a result:
lib/*.so) were not included in the built wheelcutlassfailed at runtimeRoot Cause
pyproject.tomldefines:These are different concepts:
pip installimport cutlass)[tool.setuptools.package-data]maps package names → file globs, so the key must becutlass.Fix
Update the key to match the Python package name:
How This Was Discovered
This issue was identified while working with FlashAttention, which depends on
nvidia-cutlass-dslfor its CuTeDSL-based FlashAttention-4 implementation.Steps to Reproduce
Then:
python3 -c "import cutlass; print(cutlass.__file__)"Observed error:
Investigation
After installing
nvidia-cutlass-dsl==4.4.2, thecutlassmodule was not importable despite the package being installed.Inspection revealed:
nvidia_cutlass_dsl.pthlisted in RECORD but not written to disk → Python path not updatedcutlass/package files listed in RECORD but missing from installationThis indicates an incomplete/corrupted wheel, consistent with setuptools skipping
package-datadue to the incorrect key.Workaround
Until a fixed wheel is published:
This forces reinstallation and restores the missing files.
Impact
This affects:
nvidia-cutlass-dsl(e.g., FlashAttention-4)Users may encounter:
immediately after installation.