From 77f95d61519cc1ef20a016bb7d179f0e616b3682 Mon Sep 17 00:00:00 2001 From: ydshieh Date: Thu, 20 Aug 2026 16:42:57 +0200 Subject: [PATCH 1/4] [InternVL] Fix stale expected values for Llama integration tests (cuda sm_80) The expected logits and generated text for `("cuda", 8)` (Ampere GPUs) in `test_llama_small_model_integration_forward` and `test_llama_small_model_integration_generate_text_only` were stale after the CI docker was updated to torch 2.10 (commit c0fe6164d0, "Update Nvidia CI docker file to use torch 2.10"). The actual model outputs are identical across all code commits; the drift is purely due to the torch version change. Co-Authored-By: Claude Sonnet 4.6 --- tests/models/internvl/test_modeling_internvl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/models/internvl/test_modeling_internvl.py b/tests/models/internvl/test_modeling_internvl.py index a6080c96cd88..b08096bde742 100644 --- a/tests/models/internvl/test_modeling_internvl.py +++ b/tests/models/internvl/test_modeling_internvl.py @@ -672,7 +672,7 @@ def test_llama_small_model_integration_forward(self): { ("xpu", 3): [-9.8828, -0.4954, 1.4561, -10.3438, -10.3438], ("cuda", 7): [-9.8750, -0.4861, 1.4648, -10.3359, -10.3359], - ("cuda", 8): [-9.8906, -0.4995, 1.4473, -10.3359, -10.3438], + ("cuda", 8): [-9.8750, -0.4900, 1.4629, -10.3281, -10.3359], ("rocm", (9, 4)): [ -9.8672, -0.4888, 1.4648, -10.3281, -10.3281], ("rocm", (9, 5)): [ -9.8906, -0.4976, 1.4502, -10.3359, -10.3438], } @@ -707,7 +707,7 @@ def test_llama_small_model_integration_generate_text_only(self): { ("xpu", 3): "Autumn leaves fall,\nNature's breath, a season's sigh,\nSilent woods awake.", ("cuda", 7): "Autumn leaves fall,\nNature's breath, a gentle sigh,\nSilent whispers.", - ("cuda", 8): "Autumn leaves fall,\nNature's breath, a silent sigh,\nWinter's chill approaches.", + ("cuda", 8): "Autumn leaves fall,\nNature's breath, a season's sigh,\nSilent woods awake.", } ) expected_output = expected_outputs.get_expectation() From b8c99723e27b285029b215c5a0f2349c26b4d70c Mon Sep 17 00:00:00 2001 From: ydshieh Date: Thu, 20 Aug 2026 16:56:34 +0200 Subject: [PATCH 2/4] [InternVL] Fix stale expected value for interleaved test output[0] (cuda sm_80) `test_llama_small_model_integration_interleaved_images_videos` started failing for `("cuda", 8)` (output[0]) after the CI docker was updated to torch 2.13.0 / CUDA 13.0 (commit `d79d0c1ed3`, PR #47738). Verified: both the passing commit (`b3a36037d3`, Aug 3 CI run) and the failing commit (`ff2421c67f`, Aug 4 CI run) produce identical actual output when run under the current docker. No code regression; the drift is purely from the torch version change. New value matches the existing `("cuda", 7)` expected string. Co-Authored-By: Claude Sonnet 4.6 --- tests/models/internvl/test_modeling_internvl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/models/internvl/test_modeling_internvl.py b/tests/models/internvl/test_modeling_internvl.py index b08096bde742..bdd31ea9b6cc 100644 --- a/tests/models/internvl/test_modeling_internvl.py +++ b/tests/models/internvl/test_modeling_internvl.py @@ -948,7 +948,7 @@ def test_llama_small_model_integration_interleaved_images_videos(self): { ("xpu", 3): "user\n\n\nWhat are the difference between these two images?\nassistant\nI apologize for the confusion in my previous response. Upon closer inspection, the differences between the two images are:\n\n1. **", ("cuda", 7): 'user\n\n\nWhat are the difference between these two images?\nassistant\nI apologize for the confusion in my previous response. Upon closer inspection, the differences between the two images are:\n\n1. **', - ("cuda", 8): 'user\n\n\nWhat are the difference between these two images?\nassistant\nI apologize for the confusion in my previous response. After re-examining the images, I can see that there are no', + ("cuda", 8): 'user\n\n\nWhat are the difference between these two images?\nassistant\nI apologize for the confusion in my previous response. Upon closer inspection, the differences between the two images are:\n\n1. **', ("rocm", (9, 4)): 'user\n\n\nWhat are the difference between these two images?\nassistant\nI apologize for the confusion in my previous response. After re-examining the images, I can see that there are no', ("rocm", (9, 5)): 'user\n\n\nWhat are the difference between these two images?\nassistant\nI apologize for the confusion in my previous response. After re-examining the images, I can see that there are no', } From c26bcecd7a1289bcbdbc314ef385049d889afab7 Mon Sep 17 00:00:00 2001 From: ydshieh Date: Thu, 20 Aug 2026 17:01:25 +0200 Subject: [PATCH 3/4] [InternVL] Remove ("cuda", 7) entries from all integration test Expectations cuda sm_70 (Volta) is no longer in the CI runner fleet; remove all stale entries to keep the test file clean. Co-Authored-By: Claude Sonnet 4.6 --- tests/models/internvl/test_modeling_internvl.py | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/tests/models/internvl/test_modeling_internvl.py b/tests/models/internvl/test_modeling_internvl.py index bdd31ea9b6cc..1f1412258451 100644 --- a/tests/models/internvl/test_modeling_internvl.py +++ b/tests/models/internvl/test_modeling_internvl.py @@ -279,7 +279,6 @@ def test_qwen2_small_model_integration_forward(self): expected_logits_all = Expectations( { ("xpu", 3): torch.tensor([11.9922, 14.7188, 14.3125, 10.6719, 6.9297], dtype=torch.float16), - ("cuda", 7): torch.tensor([11.9531, 14.7031, 14.2734, 10.6562, 6.9219], dtype=torch.float16), ("cuda", 8): torch.tensor([11.9609, 14.7188, 14.2734, 10.6484, 6.9141], dtype=torch.float16), } ) # fmt: skip @@ -309,7 +308,6 @@ def test_qwen2_small_model_integration_generate_text_only(self): expected_outputs = Expectations( { ("xpu", 3): "Whispers of dawn,\nSilent whispers of night,\nPeace in the stillness.", - ("cuda", 7): 'Whispers of dawn,\nSilent whispers of night,\nPeace in the stillness.', ("cuda", 8): 'Whispers of dawn,\nSilent whispers of night,\nPeace in the stillness.', } ) # fmt: skip @@ -384,7 +382,6 @@ def test_qwen2_small_model_integration_batched_generate(self): expected_outputs = Expectations( { ("xpu", 3): 'user\n\nDescribe this image\nassistant\nThe image shows a street scene with a traditional Chinese archway, known as a "Chinese Gate" or "Chinese Gate of', - ("cuda", 7): 'user\n\nDescribe this image\nassistant\nThe image shows a street scene with a traditional Chinese archway, known as a "Chinese Gate" or "Chinese Gate of', } ) # fmt: skip expected_output = expected_outputs.get_expectation() @@ -433,7 +430,6 @@ def test_qwen2_small_model_integration_batched_generate_multi_image(self): expected_outputs = Expectations( { ("xpu", 3): 'user\n\nWrite a haiku for this image\nassistant\nSilky lake, \nWooden pier, \nNature\'s peace.', - ("cuda", 7): 'user\n\nWrite a haiku for this image\nassistant\nSilky lake, \nWooden pier, \nNature\'s peace.', ("rocm", (9, 4)): 'user\n\nWrite a haiku for this image\nassistant\nSilky lake, \nWooden pier, \nNature\'s embrace.', } ) # fmt: skip @@ -449,7 +445,6 @@ def test_qwen2_small_model_integration_batched_generate_multi_image(self): expected_outputs = Expectations( { ("xpu", 3): "user\n\nWhat are the differences between these two images?\nassistant\nThe images show the Statue of Liberty and the Golden Gate Bridge from different angles. Here are the differences:\n\n1. **Foreground", - ("cuda", 7): "user\n\nWhat are the differences between these two images?\nassistant\nThe images show the Statue of Liberty and the Golden Gate Bridge from different angles. Here are the differences:\n\n1. **Foreground", ("rocm", (9, 4)): "user\n\nWhat are the differences between these two images?\nassistant\nThe images show the Statue of Liberty and the Golden Gate Bridge from different angles. Here are the main differences:\n\n1. **", } ) # fmt: skip @@ -497,7 +492,6 @@ def test_qwen2_medium_model_integration_video(self): expected_outputs = Expectations( { ("xpu", 3): "The man is performing a forehand shot.", - ("cuda", 7): "The man is performing a forehand shot.", ("rocm", (9, 5)): "The man is performing a volley shot.", } ) # fmt: skip @@ -574,7 +568,6 @@ def test_qwen2_small_model_integration_interleaved_images_videos(self): expected_outputs = Expectations( { ("xpu", 3): "user\n\n\nWhat are the differences between these two images?\nassistant\nThe images depict two distinct scenes:\n\n1. **Left Image:**\n - The Statue of Liberty is prominently featured on an", - ("cuda", 7): 'user\n\n\nWhat are the differences between these two images?\nassistant\nThe images depict two distinct scenes:\n\n1. **Left Image:**\n - The Statue of Liberty is prominently featured on an', ("rocm", (9, 4)): 'user\n\n\nWhat are the differences between these two images?\nassistant\nThe images depict two distinct scenes:\n\n1. **Left Image:**\n - This image features the Statue of Liberty on Liberty', } ) # fmt: skip @@ -590,7 +583,6 @@ def test_qwen2_small_model_integration_interleaved_images_videos(self): expected_outputs = Expectations( { ("xpu", 3): "user\nFrame1: \nFrame2: \nFrame3: \nFrame4: \nFrame5: \nFrame6: \nFrame7: \nFrame8: \nWhat type of shot is the man performing?\nassistant\nA forehand shot", - ("cuda", 7): 'user\nFrame1: \nFrame2: \nFrame3: \nFrame4: \nFrame5: \nFrame6: \nFrame7: \nFrame8: \nWhat type of shot is the man performing?\nassistant\nA forehand shot', ("rocm", (9, 4)): 'user\nFrame1: \nFrame2: \nFrame3: \nFrame4: \nFrame5: \nFrame6: \nFrame7: \nFrame8: \nWhat type of shot is the man performing?\nassistant\nA forehand shot', } ) # fmt: skip @@ -606,7 +598,6 @@ def test_qwen2_small_model_integration_interleaved_images_videos(self): expected_outputs = Expectations( { ("xpu", 3): 'user\n\nWrite a haiku for this image\nassistant\nSilky lake, \nWooden pier, \nNature\'s peace.', - ("cuda", 7): 'user\n\nWrite a haiku for this image\nassistant\nSilky lake, \nWooden pier, \nNature\'s peace.', ("rocm", (9, 4)): 'user\n\nWrite a haiku for this image\nassistant\nSilky lake, \nWooden pier, \nNature\'s embrace.', } ) # fmt: skip @@ -671,7 +662,6 @@ def test_llama_small_model_integration_forward(self): expected_logits_all = Expectations( { ("xpu", 3): [-9.8828, -0.4954, 1.4561, -10.3438, -10.3438], - ("cuda", 7): [-9.8750, -0.4861, 1.4648, -10.3359, -10.3359], ("cuda", 8): [-9.8750, -0.4900, 1.4629, -10.3281, -10.3359], ("rocm", (9, 4)): [ -9.8672, -0.4888, 1.4648, -10.3281, -10.3281], ("rocm", (9, 5)): [ -9.8906, -0.4976, 1.4502, -10.3359, -10.3438], @@ -706,7 +696,6 @@ def test_llama_small_model_integration_generate_text_only(self): expected_outputs = Expectations( { ("xpu", 3): "Autumn leaves fall,\nNature's breath, a season's sigh,\nSilent woods awake.", - ("cuda", 7): "Autumn leaves fall,\nNature's breath, a gentle sigh,\nSilent whispers.", ("cuda", 8): "Autumn leaves fall,\nNature's breath, a season's sigh,\nSilent woods awake.", } ) @@ -769,7 +758,6 @@ def test_llama_small_model_integration_batched_generate(self): expected_outputs = Expectations( { ("xpu", 3): "user\n\nWrite a haiku for this image\nassistant\nMajestic snow-capped peaks,\nWooden dock stretches to the sea,\nSilent water mirrors.", - ("cuda", 7): 'user\n\nWrite a haiku for this image\nassistant\nMajestic snow-capped peaks,\nWooden dock stretches to the sea,\nSilent water mirrors.', ("cuda", 8): 'user\n\nWrite a haiku for this image\nassistant\nMajestic snow-capped peaks,\nWooden dock stretches to the sea,\nSilent water mirrors.', } ) # fmt: skip @@ -947,7 +935,6 @@ def test_llama_small_model_integration_interleaved_images_videos(self): expected_outputs = Expectations( { ("xpu", 3): "user\n\n\nWhat are the difference between these two images?\nassistant\nI apologize for the confusion in my previous response. Upon closer inspection, the differences between the two images are:\n\n1. **", - ("cuda", 7): 'user\n\n\nWhat are the difference between these two images?\nassistant\nI apologize for the confusion in my previous response. Upon closer inspection, the differences between the two images are:\n\n1. **', ("cuda", 8): 'user\n\n\nWhat are the difference between these two images?\nassistant\nI apologize for the confusion in my previous response. Upon closer inspection, the differences between the two images are:\n\n1. **', ("rocm", (9, 4)): 'user\n\n\nWhat are the difference between these two images?\nassistant\nI apologize for the confusion in my previous response. After re-examining the images, I can see that there are no', ("rocm", (9, 5)): 'user\n\n\nWhat are the difference between these two images?\nassistant\nI apologize for the confusion in my previous response. After re-examining the images, I can see that there are no', @@ -965,7 +952,6 @@ def test_llama_small_model_integration_interleaved_images_videos(self): expected_outputs = Expectations( { ("xpu", 3): "user\nFrame1: \nFrame2: \nFrame3: \nFrame4: \nFrame5: \nFrame6: \nFrame7: \nFrame8: \nWhat type of shot is the man performing?\nassistant\nThe man is performing a forehand shot. This is a common stroke in tennis where the player swings the racket across their", - ("cuda", 7): 'user\nFrame1: \nFrame2: \nFrame3: \nFrame4: \nFrame5: \nFrame6: \nFrame7: \nFrame8: \nWhat type of shot is the man performing?\nassistant\nThe man is performing a forehand shot. This is a common stroke in tennis where the player swings the racket across their', ("cuda", 8): 'user\nFrame1: \nFrame2: \nFrame3: \nFrame4: \nFrame5: \nFrame6: \nFrame7: \nFrame8: \nWhat type of shot is the man performing?\nassistant\nThe man is performing a forehand shot. This is a common stroke in tennis where the player swings the racket across their', } ) # fmt: skip @@ -981,7 +967,6 @@ def test_llama_small_model_integration_interleaved_images_videos(self): expected_outputs = Expectations( { ("xpu", 3): "user\n\nWrite a haiku for this image\nassistant\nMajestic snow-capped peaks,\nWooden dock stretches to the sea,\nSilent water mirrors.", - ("cuda", 7): 'user\n\nWrite a haiku for this image\nassistant\nMajestic snow-capped peaks,\nWooden dock stretches to the sea,\nSilent water mirrors.', ("cuda", 8): 'user\n\nWrite a haiku for this image\nassistant\nMajestic snow-capped peaks,\nWooden dock stretches to the sea,\nSilent water mirrors.', } ) # fmt: skip From 95cffbbdf0fa23d1e87f2b0efc382cc01de5f790 Mon Sep 17 00:00:00 2001 From: ydshieh Date: Thu, 20 Aug 2026 17:14:32 +0200 Subject: [PATCH 4/4] [InternVL] Add ("cuda", 8) entries to all Expectations blocks After removing ("cuda", 7) entries, blocks with only xpu/rocm keys left cuda sm_80 with no match (ValueError) or the wrong rocm fallback. Add explicit ("cuda", 8) entries with the correct values to all affected Expectations blocks. Co-Authored-By: Claude Sonnet 4.6 --- tests/models/internvl/test_modeling_internvl.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/models/internvl/test_modeling_internvl.py b/tests/models/internvl/test_modeling_internvl.py index 1f1412258451..93a295d7a194 100644 --- a/tests/models/internvl/test_modeling_internvl.py +++ b/tests/models/internvl/test_modeling_internvl.py @@ -382,6 +382,7 @@ def test_qwen2_small_model_integration_batched_generate(self): expected_outputs = Expectations( { ("xpu", 3): 'user\n\nDescribe this image\nassistant\nThe image shows a street scene with a traditional Chinese archway, known as a "Chinese Gate" or "Chinese Gate of', + ("cuda", 8): 'user\n\nDescribe this image\nassistant\nThe image shows a street scene with a traditional Chinese archway, known as a "Chinese Gate" or "Chinese Gate of', } ) # fmt: skip expected_output = expected_outputs.get_expectation() @@ -430,6 +431,7 @@ def test_qwen2_small_model_integration_batched_generate_multi_image(self): expected_outputs = Expectations( { ("xpu", 3): 'user\n\nWrite a haiku for this image\nassistant\nSilky lake, \nWooden pier, \nNature\'s peace.', + ("cuda", 8): 'user\n\nWrite a haiku for this image\nassistant\nSilky lake, \nWooden pier, \nNature\'s peace.', ("rocm", (9, 4)): 'user\n\nWrite a haiku for this image\nassistant\nSilky lake, \nWooden pier, \nNature\'s embrace.', } ) # fmt: skip @@ -445,6 +447,7 @@ def test_qwen2_small_model_integration_batched_generate_multi_image(self): expected_outputs = Expectations( { ("xpu", 3): "user\n\nWhat are the differences between these two images?\nassistant\nThe images show the Statue of Liberty and the Golden Gate Bridge from different angles. Here are the differences:\n\n1. **Foreground", + ("cuda", 8): "user\n\nWhat are the differences between these two images?\nassistant\nThe images show the Statue of Liberty and the Golden Gate Bridge from different angles. Here are the differences:\n\n1. **Foreground", ("rocm", (9, 4)): "user\n\nWhat are the differences between these two images?\nassistant\nThe images show the Statue of Liberty and the Golden Gate Bridge from different angles. Here are the main differences:\n\n1. **", } ) # fmt: skip @@ -492,6 +495,7 @@ def test_qwen2_medium_model_integration_video(self): expected_outputs = Expectations( { ("xpu", 3): "The man is performing a forehand shot.", + ("cuda", 8): "The man is performing a forehand shot.", ("rocm", (9, 5)): "The man is performing a volley shot.", } ) # fmt: skip @@ -568,6 +572,7 @@ def test_qwen2_small_model_integration_interleaved_images_videos(self): expected_outputs = Expectations( { ("xpu", 3): "user\n\n\nWhat are the differences between these two images?\nassistant\nThe images depict two distinct scenes:\n\n1. **Left Image:**\n - The Statue of Liberty is prominently featured on an", + ("cuda", 8): 'user\n\n\nWhat are the differences between these two images?\nassistant\nThe images depict two distinct scenes:\n\n1. **Left Image:**\n - The Statue of Liberty is prominently featured on an', ("rocm", (9, 4)): 'user\n\n\nWhat are the differences between these two images?\nassistant\nThe images depict two distinct scenes:\n\n1. **Left Image:**\n - This image features the Statue of Liberty on Liberty', } ) # fmt: skip @@ -583,6 +588,7 @@ def test_qwen2_small_model_integration_interleaved_images_videos(self): expected_outputs = Expectations( { ("xpu", 3): "user\nFrame1: \nFrame2: \nFrame3: \nFrame4: \nFrame5: \nFrame6: \nFrame7: \nFrame8: \nWhat type of shot is the man performing?\nassistant\nA forehand shot", + ("cuda", 8): 'user\nFrame1: \nFrame2: \nFrame3: \nFrame4: \nFrame5: \nFrame6: \nFrame7: \nFrame8: \nWhat type of shot is the man performing?\nassistant\nA forehand shot', ("rocm", (9, 4)): 'user\nFrame1: \nFrame2: \nFrame3: \nFrame4: \nFrame5: \nFrame6: \nFrame7: \nFrame8: \nWhat type of shot is the man performing?\nassistant\nA forehand shot', } ) # fmt: skip @@ -598,6 +604,7 @@ def test_qwen2_small_model_integration_interleaved_images_videos(self): expected_outputs = Expectations( { ("xpu", 3): 'user\n\nWrite a haiku for this image\nassistant\nSilky lake, \nWooden pier, \nNature\'s peace.', + ("cuda", 8): 'user\n\nWrite a haiku for this image\nassistant\nSilky lake, \nWooden pier, \nNature\'s peace.', ("rocm", (9, 4)): 'user\n\nWrite a haiku for this image\nassistant\nSilky lake, \nWooden pier, \nNature\'s embrace.', } ) # fmt: skip