Skip to content

Conversation

@LeiWang1999
Copy link
Member

@LeiWang1999 LeiWang1999 commented Jan 27, 2026

As our benchmark shows that the performance is not always better than the default nvcc optimiztaions.

  • Changed the configuration option from kDisableLowerLDGSTGPredicated to kEnableLowerLDGSTGPredicated to enable predicated lowering of global load/store operations.
  • Updated relevant comments and documentation to reflect the new configuration behavior.
  • Adjusted tests to utilize the new configuration option for enabling predicated lowering, ensuring consistency across the codebase.

Summary by CodeRabbit

  • Chores
    • Renamed and inverted pass configuration option for LDGSTG predicated lowering: the flag now enables the feature when set to True rather than disabling it when True. Users with existing configurations using the old flag will need to update their settings accordingly.

✏️ Tip: You can customize this high-level summary in your review settings.

- Changed the configuration option from `kDisableLowerLDGSTGPredicated` to `kEnableLowerLDGSTGPredicated` to enable predicated lowering of global load/store operations.
- Updated relevant comments and documentation to reflect the new configuration behavior.
- Adjusted tests to utilize the new configuration option for enabling predicated lowering, ensuring consistency across the codebase.
@github-actions
Copy link

👋 Hi! Thank you for contributing to the TileLang project.

Please remember to run pre-commit run --all-files in the root directory of the project to ensure your changes are properly linted and formatted. This will help ensure your contribution passes the format check.

We appreciate you taking this step! Our team will review your contribution, and we look forward to your awesome work! 🚀

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 27, 2026

📝 Walkthrough

Walkthrough

Refactoring of a public pass configuration flag across the codebase: the boolean option controlling LDG/STG predicated lowering is renamed from kDisableLowerLDGSTGPredicated to kEnableLowerLDGSTGPredicated, inverting the semantics from disable-based to enable-based logic. All references—including the configuration key enum, public constants, implementation logic, and tests—are updated consistently.

Changes

Cohort / File(s) Summary
Configuration & Public Declarations
src/op/builtin.h, tilelang/transform/pass_config.py
Rename public constant and enum member from kDisableLowerLDGSTGPredicated / TL_DISABLE_LOWER_LDGSTG_PREDICATED to enable variants; update string literal from "tl.disable_lower_ldgstg_predicated" to "tl.enable_lower_ldgstg_predicated"; update docstrings to reflect enabling semantics.
Option Registration & Implementation
src/op/builtin.cc, src/transform/lower_ldg_stg.cc
Register and use the renamed enable flag; invert logic to read enable_predicated directly with default false instead of reading inverted disable flag.
Test Suite
testing/python/transform/test_tilelang_transform_lower_ldgstg.py
Update _apply_passes() helper signature to use enable_predicated parameter; update all test call sites and end-to-end test decorators to use PassConfigKey.TL_ENABLE_LOWER_LDGSTG_PREDICATED with explicit boolean values.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • chengyupku

Poem

🐰 Hops with glee through config land,
Disable becomes Enable—oh how grand!
A flag inverted, semantics bright,
Predicated lowering shines in light!

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Title check ⚠️ Warning The title states 'Disable Predicated LDG PTX Lowering by default', but the actual changes rename the flag from kDisableLowerLDGSTGPredicated to kEnableLowerLDGSTGPredicated and flip the default, making the feature opt-in rather than implying it's being disabled. Revise the title to accurately reflect that the change makes predicated lowering opt-in by default, such as '[Refactor] Make predicated LDG/STG lowering opt-in by default' or '[Refactor] Invert predicated lowering flag semantics'.
Docstring Coverage ⚠️ Warning Docstring coverage is 47.06% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@testing/python/transform/test_tilelang_transform_lower_ldgstg.py`:
- Line 138: Update the misleading inline comments that state "Default:
predicated is ON" next to calls to _apply_passes(..., enable_predicated=True);
the new semantics default predication to OFF, so change those comments (the ones
adjacent to the _apply_passes calls referencing enable_predicated=True) to
reflect "Default: predicated is OFF" or remove the misleading default note so
the comment matches the actual behavior.
🧹 Nitpick comments (1)
src/transform/lower_ldg_stg.cc (1)

301-304: Consider updating the default member initializer for consistency.

The member enable_predicated_ is initialized to true at line 304, but the constructor (lines 42-45) always overrides this value with the parameter passed from the pass function. Since the pass now defaults to false (line 496), updating this member initializer to false would improve code clarity and maintain consistency with the new default semantics.

♻️ Suggested change
 private:
   bool in_async_scope_{false};
   bool enable_non_predicated_{false};
-  bool enable_predicated_{true};
+  bool enable_predicated_{false};


mod = tvm.IRModule.from_expr(func.with_attr("global_symbol", "main"))
mod = _apply_passes(mod) # Default: predicated is ON
mod = _apply_passes(mod, enable_predicated=True) # Default: predicated is ON
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Misleading inline comment.

The comment says "Default: predicated is ON" but with the new semantics, the default is OFF. The test correctly passes enable_predicated=True to enable it, but the comment should be updated.

📝 Suggested fix
-    mod = _apply_passes(mod, enable_predicated=True)  # Default: predicated is ON
+    mod = _apply_passes(mod, enable_predicated=True)  # Explicitly enable predicated lowering

The same applies to lines 155, 172, and 190.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
mod = _apply_passes(mod, enable_predicated=True) # Default: predicated is ON
mod = _apply_passes(mod, enable_predicated=True) # Explicitly enable predicated lowering
🤖 Prompt for AI Agents
In `@testing/python/transform/test_tilelang_transform_lower_ldgstg.py` at line
138, Update the misleading inline comments that state "Default: predicated is
ON" next to calls to _apply_passes(..., enable_predicated=True); the new
semantics default predication to OFF, so change those comments (the ones
adjacent to the _apply_passes calls referencing enable_predicated=True) to
reflect "Default: predicated is OFF" or remove the misleading default note so
the comment matches the actual behavior.

@LeiWang1999 LeiWang1999 merged commit 350f987 into tile-ai:main Jan 27, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant