[CuTeDSL] Fix _ScalarData internal methods triggering its own struct.scalar deprecation#3311
Open
Johnsonms wants to merge 1 commit into
Open
[CuTeDSL] Fix _ScalarData internal methods triggering its own struct.scalar deprecation#3311Johnsonms wants to merge 1 commit into
Johnsonms wants to merge 1 commit into
Conversation
…scalar deprecation `_ScalarData.value` is a @deprecated property ("Using `struct.scalar` as pointer is deprecated; use `struct.scalar.ptr`") that simply returns `self._ptr.value`. But the class's own `__get_mlir_types__`, `__extract_mlir_values__` and `to_llvm_ptr` call `self.value`, so the class triggers its own deprecation warning on every use (e.g. each TMEM/SMEM pointer extracted as a JIT value) — flooding logs with DeprecationWarnings the user cannot act on. Use `self._ptr.value` directly in these internal methods. Behaviorally identical (the deprecated property only emits the warning, then returns the same `self._ptr.value`).
4116a35 to
35f44ed
Compare
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.
Problem
_ScalarData.value(incutlass/cute/core.py) is a@deprecatedproperty —— that just returns
self._ptr.value. But the class's own internal methods callself.value:__get_mlir_types__→[self.value.type]__extract_mlir_values__→[self.value]to_llvm_ptr→[..., [self.value], ...]So the class triggers its own deprecation warning on every use — e.g. each time a TMEM/SMEM scalar pointer is extracted as a JIT value. In a real workload this floods the logs with
DeprecationWarnings the user can't act on (they aren't usingstruct.scalaras a pointer — the library is, internally).Fix
Call
self._ptr.valuedirectly in those three internal methods. Behaviorally identical — the deprecated property only emits the warning and then returns the sameself._ptr.value.Evidence
A single FlashAttention-4 SM100 forward launch (deprecation warnings counted):
core.py__extract_mlir_values__core.pyto_llvm_ptrcore.pyvalueproperty (self-triggered)arch/tmem.py:110/155~89% of the
struct.scalardeprecation noise removed. The remaining ~8 come from a different path —tmem_allocator.pypassing a scalar intoalloc_tmem/retrieve_tmem_ptr, wherearch/tmem.pythen does.value. That's a separate caller-side fix and is intentionally out of scope here.No functional change; fixes only the self-inflicted warning.