Truong Vu

Results issues of Truong Vu

Patching the LLaMA model with FlashAttn 2. Tested on a A100 40GB machine, flash-attn v2.3.6: ~20% VRAM reduced, ~10% throughput increased.

## Summary `_fwd_kernel` and the backward turn a byte offset into a row index by dividing by `stride_qm`. That is exact only when the tensor is a contiguous `[Z, H,...

## Summary Both norm layers allocate the per-program weight-gradient buffer with `batch_dim // BLOCK_SIZE_BATCH` but launch `cdiv(batch_dim, BLOCK_SIZE_BATCH)` programs. Whenever the block size does not divide the batch dimension there...

## Summary ATen's `hardswish_backward` is `0` for `x < -3`, `x/3 + 0.5` on the **closed** `[-3, 3]`, and `1` for `x > 3`. attorch composes the gradient out of...

## Summary `SmoothL1Loss` and `HuberLoss` switch from their quadratic piece to their linear piece at a threshold on the **absolute** difference `|input - target|`. The kernels compare the **signed** difference...

## Summary For both shrink functions, ATen's zero band is the **closed** interval `[-lambd, lambd]`: at `|x| == lambd` the output is 0 and so is the gradient. attorch tests...

## Summary `rms_norm_backward_kernel` multiplies the input by a rank-1 per-row reduction without adding a trailing axis. Triton broadcasts a rank-1 operand along the **last** axis, so the term is applied...

### Is there an existing issue for this bug? - [x] I have searched the existing issues ### The bug has not been fixed in the latest main branch -...

bug

## Describe the bug `apply_rotary_emb_triton` in `python/sglang/kernels/ops/attention/deepseek_v4_rope.py` picks one of three kernels for the same operation. Two of them mask the column axis against the real rotary width: ```python apply_rotary_emb_triton_kernel...

inactive

## Summary `kernel_fwd` builds exactly the bounds mask its output store needs, on the line directly above the store, and then calls `tl.store(C, acc)` without it. The host grid rounds...