mamba-ssm: fix selective_state_update launch args when D or dt_bias is None - #1077
Conversation
…s None `D` and `dt_bias` are documented as optional, but passing either as None raises before the kernel is reached: - `*(D.stride(0), D.stride(1)) if D is not None else 0` parses as `*((D.stride(0), D.stride(1)) if D is not None else 0)`, because a conditional expression binds looser than the unpacking, so the None case unpacks the int 0 and raises "Value after * must be an iterable, not int". Build the tuple first and pass a (0, 0) placeholder, matching how `z_strides` a few lines above already handles the same situation. - `tie_hdim` dereferences `dt_bias.stride(-1)` unconditionally, so it raises on None before the launch args are even evaluated. Both are plain Python bugs and reproduce on CUDA.
|
/kernel-bot build mamba-ssm |
|
Build request processed. Command: Dispatched (1):
|
|
/kernel-bot merge-and-upload mamba-ssm |
|
Build request failed. Command: Failure: Failed to merge PR before build/upload. Check mergeability and required checks. |
|
/kernel-bot merge-and-upload mamba-ssm |
|
Build request processed. Command: Merge result: PR is already merged. Continuing with build/upload. Dispatched (1):
Hub uploads: |
Summary
Danddt_biasare documented as optional, but passing either asNoneraises before the kernel is reached.
*(D.stride(0), D.stride(1)) if D is not None else 0parses as*((D.stride(0), D.stride(1)) if D is not None else 0)— a conditionalexpression binds looser than the unpacking — so the
Nonecase tries to unpackthe int
0:Build the tuple first and pass a
(0, 0)placeholder, which is howz_stridesa few lines above already handles the same situation.
tie_hdimseparately dereferencesdt_bias.stride(-1)unconditionally, so itraises on
Nonebefore the launch args are even evaluated.Both are plain Python bugs and reproduce on CUDA.