Conversation
There was a problem hiding this comment.
Code Review
This pull request updates compressed_tensors_wNa16_moe.py to properly handle self.actorder when it is an Enum or a mixed-case string. The reviewer suggests normalizing self.actorder in-place on the instance rather than using a local variable, ensuring that other references to self.actorder within the class also benefit from this normalization and evaluate correctly.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| actorder = getattr(self.actorder, "value", self.actorder) | ||
| if isinstance(actorder, str): | ||
| actorder = actorder.lower() | ||
| load_full_w2 = ( | ||
| actorder not in (None, False, "", "static") and self.group_size != -1 | ||
| ) |
There was a problem hiding this comment.
By normalizing self.actorder in-place rather than using a local variable, we ensure that other references to self.actorder in this class also benefit from the normalization.
Specifically:
- On line 145,
self.is_k_full = (not self.actorder) ...will evaluate correctly. Ifself.actorderis an Enum member (e.g.,ActOrder.NONE),not self.actorderwould incorrectly evaluate toFalsebecause Python Enum members are always truthy. - On line 303,
if self.actorder == "group":will correctly match the string value instead of failing when compared against an Enum member or a mixed-case string.
| actorder = getattr(self.actorder, "value", self.actorder) | |
| if isinstance(actorder, str): | |
| actorder = actorder.lower() | |
| load_full_w2 = ( | |
| actorder not in (None, False, "", "static") and self.group_size != -1 | |
| ) | |
| self.actorder = getattr(self.actorder, "value", self.actorder) | |
| if isinstance(self.actorder, str): | |
| self.actorder = self.actorder.lower() | |
| load_full_w2 = ( | |
| self.actorder not in (None, False, "", "static") and self.group_size != -1 | |
| ) |
Experiment: the K2.6 w2 _load_w2 narrow IndexError on AMD is non-deterministic (different TP rank reported first across days: got 192/320/448, plus a segfault day), with the load/shard code and the HF checkpoint unchanged. This points to a race in multithreaded weight loading rather than a deterministic sharding bug. Disable enable_multithread_load for both kimi-k26 accuracy jobs to test whether the IndexError disappears. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
463c6d6 to
ac6ae22
Compare
Experiment: disable
|
Summary
w2_weight_scalefor checkpoints whose w2 scales are already per-rank, such as Kimi-K2.6.Validation
PYTHONPYCACHEPREFIX=/tmp/sglang-pycache python3 -m py_compile python/sglang/srt/layers/quantization/compressed_tensors/schemes/compressed_tensors_wNa16_moe.pygit commitCI
CI States
Latest PR Test (Base): ❌ Run #28089355031
Latest PR Test (Extra): ❌ Run #28089354818