CUDApp
CUDA++: AIEN’s GPU machine-code toolchain, runtime and driver client for NVIDIA GPUs without the CUDA toolkit. Hardware coverage and driver replacement limits are explicit.
Brought by drakestapleton
CUDApp / evidence / AMD-GFX942-GDNCONV4 / reference-lines.txt
| 1 | URL https://raw.githubusercontent.com/huggingface/transformers/v5.8.0/src/transformers/models/qwen3_5/modeling_qwen3_5.py |
| 2 | sha256 641da34484f6b9769e28615c680cc4e3202afbf5bdbf1da7d56d5a3d678918c7 |
| 3 | 211: hidden_states, |
| 4 | 212: conv_state, |
| 5 | 213: weight, |
| 6 | 214: bias=None, |
| 7 | 215: activation=None, |
| 8 | 216:): |
| 9 | 217: _, hidden_size, seq_len = hidden_states.shape |
| 10 | 218: state_len = conv_state.shape[-1] |
| 11 | 219: |
| 12 | 220: hidden_states_new = torch.cat([conv_state, hidden_states], dim=-1).to(weight.dtype) |
| 13 | 221: conv_state.copy_(hidden_states_new[:, :, -state_len:]) |
| 14 | 222: out = F.conv1d(hidden_states_new, weight.unsqueeze(1), bias, padding=0, groups=hidden_size) |
| 15 | 223: out = F.silu(out[:, :, -seq_len:]) |
| 16 | 224: out = out.to(hidden_states.dtype) |
| 17 | 225: return out |
| 18 | 455: if use_precomputed_states and seq_len == 1: |
| 19 | 456: # Single-token cached decode: the fused per-step kernel updates the conv state in-place. |
| 20 | 457: mixed_qkv = self.causal_conv1d_update( |
| 21 | 458: mixed_qkv, |
| 22 | 459: conv_state, |
| 23 | 460: self.conv1d.weight.squeeze(1), |
| 24 | 461: self.conv1d.bias, |
| 25 | 462: self.activation, |
| 26 | 463: ) |