Skip to content

[Enhancement] Disable data race check by default, opt-in via env var - #2851

Merged
LeiWang1999 merged 1 commit into
tile-ai:mainfrom
KellyFrog:fix/default-disable-data-race-check
Aug 3, 2026
Merged

[Enhancement] Disable data race check by default, opt-in via env var#2851
LeiWang1999 merged 1 commit into
tile-ai:mainfrom
KellyFrog:fix/default-disable-data-race-check

Conversation

@KellyFrog

@KellyFrog KellyFrog commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

The VerifyParallelLoop data race check can report false positives on shared buffer stores whose per-thread addresses cannot be proven distinct (e.g. indices loaded from fragments).

Now disabled it by default; users can opt in via the TILELANG_ENABLE_DATA_RACE_CHECK environment variable or by explicitly setting the tl.disable_data_race_check pass config to False.

Summary

  • Disabled VerifyParallelLoop data-race checking by default.
  • Added TILELANG_ENABLE_DATA_RACE_CHECK=1 to enable the check.
  • Preserved tl.disable_data_race_check as a pass-context override.
  • Documented false-positive cases involving shared buffer stores.
  • Added tests for default, environment-variable, and pass-configuration behavior.

C++ style / lint notes

  • The PR changes C++ code, but it does not change rules documented in docs/developer_guide/cpp_style.md.
  • The “C++ API Style Audit (warning only)” CI step may report advisory findings. These findings do not affect correctness, build behavior, or test coverage.

The VerifyParallelLoop data race check can report false positives on
shared buffer stores whose per-thread addresses cannot be proven
distinct (e.g. indices loaded from fragments). Disable it by default;
users can opt in via the TILELANG_ENABLE_DATA_RACE_CHECK environment
variable or by explicitly setting the tl.disable_data_race_check pass
config to False.
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

👋 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

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Data-race checking is now disabled by default. TILELANG_ENABLE_DATA_RACE_CHECK=1 enables it, while tl.disable_data_race_check can disable it per compilation. Documentation, diagnostics, and tests describe and verify these controls.

Changes

Data-race check configuration

Layer / File(s) Summary
Configuration controls
tilelang/backend/pass_pipeline/pipeline_utils.py, tilelang/transform/pass_config.py
The pipeline uses TILELANG_ENABLE_DATA_RACE_CHECK to control the default. TL_DISABLE_DATA_RACE_CHECK remains a per-compilation override. The configuration documentation describes both controls and possible false positives.
Validation and diagnostics
testing/python/transform/test_tilelang_transform_verify_parallel_loop.py, src/transform/verify_parallel_loop.cc
Tests cover the default, environment-variable enablement, and pass-context override. The diagnostic reports the available controls and the disabled default.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: leiwang1999, penguin-wwy

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: disabling the data race check by default and enabling it through an environment variable.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/transform/verify_parallel_loop.cc`:
- Around line 143-146: Update the diagnostic text in the verify_parallel_loop
message to reference the valid PassConfigKey.TL_DISABLE_DATA_RACE_CHECK name and
explicitly instruct users to set it to True. Keep the existing
environment-variable guidance unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 0790815f-ddd1-4da0-b202-1cfd5c1bf2b4

📥 Commits

Reviewing files that changed from the base of the PR and between a426ff3 and 942dc27.

📒 Files selected for processing (4)
  • src/transform/verify_parallel_loop.cc
  • testing/python/transform/test_tilelang_transform_verify_parallel_loop.py
  • tilelang/backend/pass_pipeline/pipeline_utils.py
  • tilelang/transform/pass_config.py

Comment on lines +143 to +146
os << "If you believe this is a false positive, disable the check by "
"setting `PassKey.TL_DISABLE_DATA_RACE_CHECK` in the pass config, "
"or by unsetting the `TILELANG_ENABLE_DATA_RACE_CHECK` environment "
"variable (the check is disabled by default).";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Use the valid pass-config name and value.

Line 144 names PassKey.TL_DISABLE_DATA_RACE_CHECK, but tilelang/transform/pass_config.py defines PassConfigKey.TL_DISABLE_DATA_RACE_CHECK. The message also does not state that the key must be set to True.

Print the valid configuration key and value.

Proposed diagnostic fix
-          "setting `PassKey.TL_DISABLE_DATA_RACE_CHECK` in the pass config, "
+          "setting `tl.disable_data_race_check` to `True` in the pass config, "
📝 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
os << "If you believe this is a false positive, disable the check by "
"setting `PassKey.TL_DISABLE_DATA_RACE_CHECK` in the pass config, "
"or by unsetting the `TILELANG_ENABLE_DATA_RACE_CHECK` environment "
"variable (the check is disabled by default).";
os << "If you believe this is a false positive, disable the check by "
"setting `tl.disable_data_race_check` to `True` in the pass config, "
"or by unsetting the `TILELANG_ENABLE_DATA_RACE_CHECK` environment "
"variable (the check is disabled by default).";
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/transform/verify_parallel_loop.cc` around lines 143 - 146, Update the
diagnostic text in the verify_parallel_loop message to reference the valid
PassConfigKey.TL_DISABLE_DATA_RACE_CHECK name and explicitly instruct users to
set it to True. Keep the existing environment-variable guidance unchanged.

@LeiWang1999
LeiWang1999 merged commit 7bfaf7d into tile-ai:main Aug 3, 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.

2 participants