From 1f51feee05497b66421498838823fe72a32a2e76 Mon Sep 17 00:00:00 2001 From: claude Date: Fri, 14 Aug 2026 11:18:02 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20cos=5Fsin=5Fcache=20dtype=20float?= =?UTF-8?q?=E2=86=92half=20in=20rope=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- qwen3_6_scripts/verify_ast_chain.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qwen3_6_scripts/verify_ast_chain.py b/qwen3_6_scripts/verify_ast_chain.py index f174b0a2..144ecdc3 100644 --- a/qwen3_6_scripts/verify_ast_chain.py +++ b/qwen3_6_scripts/verify_ast_chain.py @@ -128,7 +128,7 @@ def test_rope(): inv_freq = 1.0 / (10000.0 ** (torch.arange(0, rotary_dim, 2, dtype=torch.float32) / rotary_dim)) t = torch.arange(max_pos, dtype=torch.float32) freqs = torch.outer(t, inv_freq) - cos_sin_cache = torch.cat([freqs.cos(), freqs.sin()], dim=-1).to("cuda") + cos_sin_cache = torch.cat([freqs.cos(), freqs.sin()], dim=-1).half().to("cuda") positions = torch.arange(num_tokens, dtype=torch.long, device="cuda") q = torch.randn(num_tokens, num_heads * head_size, dtype=torch.float16, device="cuda")