Trace x shape at deepstack layers

This commit is contained in:
Daniel Maddern 2026-08-19 22:27:16 +07:00
parent b9dcdda116
commit 834bd96111

View file

@ -698,8 +698,8 @@ class Qwen3VL32BVision(nn.Module):
deepstack_features = []
for layer_num, block in enumerate(self.blocks):
x = block(x, cu_seqlens=cu_seqlens, position_embeddings=position_embeddings)
if layer_num == 0:
print(f"[vision] after block 0: x.shape={tuple(x.shape)}, grid_thw={grid_thw.tolist()}")
if layer_num in (0, 8, 16, 24) or layer_num == self.depth - 1:
print(f"[vision] after block {layer_num}: x.shape={tuple(x.shape)}")
if layer_num in self.deepstack_visual_indexes:
# x should be [N_patches, C]; if not, re-flatten.
if x.ndim != 2: