[Lang] Reject non-positive arrive_count in alloc_barrier and alloc_cluster_barrier - #3112
Conversation
|
Important Review skippedToo many files! This PR contains 1261 files, which is 961 over the limit of 300. To get a review, reduce the PR to 300 files or fewer by splitting it into smaller PRs or changing its base branch. Usage-priced reviews support at most 300 files. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (3)
📒 Files selected for processing (1261)
You can disable this status message by setting the 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. Comment |
|
👋 Hi! Thank you for contributing to the TileLang project. Please remember to run We appreciate you taking this step! Our team will review your contribution, and we look forward to your awesome work! 🚀 |
02a7f32 to
3981b14
Compare
Fixes #3030.
alloc_barrierandalloc_cluster_barrierforwarded any integer arrive count straight into thebarrier_initattribute with no positivity check, soT.alloc_barrier(0)(and negatives) compiled cleanly all the way to emitted CUDA. An mbarrier arrive count of 0 has no defined meaning — it must be at least 1 — and on Hopperbar[0].init(0)trips the CUTLASS assert at runtime; a negative count is worse, since the assert only checks!= 0, so e.g.-5slips through as a garbage unsigned value (as documented in the issue).Both functions now reject non-positive counts at trace time with a clear
ValueErrornaming the offending value, before anything reaches a device pass or codegen. The check runs on the raw argument (int or list), soalloc_barrier([128, 0])is caught too.Test:
test_alloc_barrier_rejects_non_positive_arrive_countintesting/python/language/test_tilelang_language_alloc.pyasserts the raise for0,-5, and[128, 0], and that a valid count still traces. This part is CPU-only (frontend trace, no compile), matching the arch-independence noted in the issue.