Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion tests/pytorch/attention/test_kv_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,13 @@ def get_tols(config, module, backend, dtype):
torch.bfloat16: (1.2e-1, 1e-1),
}
else:
# head_dim > 128 in fp16 is the worst case for accumulated rounding, and the
# full-sequence vs incremental-KV-cache paths use different kernels/mask types.
# On sm80 with older cuDNN the agreement grazes 1e-2 on a single element, so the
# fp16 tolerance is widened slightly. Tolerances were originally calibrated on
# Hopper/Blackwell + newer cuDNN.
tols = {
torch.half: (1e-2, 1e-2),
torch.half: (1.5e-2, 1.5e-2),
torch.bfloat16: (8e-2, 7e-2),
}
if module == "DotProductAttention":
Expand Down