[Bugfix][DiffusionGemma] Read the causal mask as int32 and compile the sample step (#59992)

Signed-off-by: ojeda-e <eojeda@league.com>
This commit is contained in:
Mia Ojeda
2026-10-06 19:25:51 +08:00
committed by GitHub
parent 09e0ce3d82
commit 3313825983
5 changed files with 24 additions and 16 deletions
+1 -1
View File
@@ -472,7 +472,7 @@ def varlen_with_paged_kv(
scale = head_size**-0.5
token_num = sum(query_lens)
dynamic_causal_tensor = (
torch.tensor(dynamic_causal, dtype=torch.bool)
torch.tensor(dynamic_causal, dtype=torch.int32)
if dynamic_causal is not None
else None
)
@@ -227,6 +227,10 @@ def test_single_step_tile_skips_self_conditioning():
assert not states.self_conditioning_embeds[0].any()
def test_sample_step_is_compiled():
assert hasattr(_compiled_sample_step, "_torchdynamo_orig_callable")
@pytest.mark.parametrize("stance", ["default", "force_eager"])
def test_self_conditioning_stores_a_bf16_model_in_the_fp32_buffer(stance):
# The model's embeddings are bf16 while the buffer is fp32. Compiled code