-
Notifications
You must be signed in to change notification settings - Fork 37
Run tests for all models #289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bigximik
reviewed
Jun 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jlamypoirier i am getting error then running pytest on some tests:
@pytest.mark.model_testing_group(ModelTestingGroup.convert)
def test_run_converted_model(model_testing_config, convert_paths):
model_ref = model_testing_config.huggingface_model_for_causal_lm_class.from_pretrained(
CheckpointLoadConfig(
path=convert_paths["checkpoint"],
format=DistributedCheckpointFormat,
load_config=ModelConfigType.model,
)
)
test_input = torch.randint(
0, model_ref.config.fast_llm_config.base_model.vocab_size, size=(4, 100), dtype=torch.int64, device="cuda"
)
output_ref = model_ref(test_input)
model_from_fast_llm = model_testing_config.huggingface_model_for_causal_lm_class.from_pretrained(
convert_paths["fast_llm_0"]
)
model_from_hf = model_testing_config.huggingface_model_for_causal_lm_class.from_pretrained(
CheckpointLoadConfig(
path=convert_paths["huggingface_0"],
format=model_testing_config.checkpoint_format,
load_config=ModelConfigType.model,
)
)
errors = []
compare = CompareConfig()
model_as_hf = transformers.AutoModel.from_pretrained(
convert_paths["huggingface_0"], trust_remote_code=model_testing_config.checkpoint_format.trust_remote_code
).cuda()
for name, model in zip(
("From state dict", "From Huggingface", "Native Huggingface"),
(model_from_fast_llm, model_from_hf, model_as_hf),
):
print(name)
output = model(test_input)
# TODO: Make a generic comparison util.
compare_logged_tensor(
{"samples": output_ref.logits, "shape": output_ref.logits.shape, "step": 0},
> {"samples": output.logits, "shape": output.logits.shape, "step": 0},
^^^^^^^^^^^^^
errors,
name,
"logits",
compare,
)
E AttributeError: 'BaseModelOutputWithPast' object has no attribute 'logits'
tests/models/test_checkpoint.py:457: AttributeError
other failed tests:
FAILED tests/models/test_match_megatron.py::test_megatron[gpt2]@dependency_group_28 - RuntimeError: Process failed with return code 1
FAILED tests/models/test_match_megatron.py::test_megatron[llama]@dependency_group_31 - RuntimeError: Process failed with return code 1
FAILED tests/test_functional.py::test_dropless_mlp - Failed: Test fails, aborting to avoid breaking cuda
FAILED tests/models/test_simple.py::test_model[llamba]@dependency_group_25 - ValueError: Comparison failed (1 errors)
FAILED tests/models/test_checkpoint.py::test_run_converted_model[starcoder2]@dependency_group_1 - AttributeError: 'BaseModelOutputWithPast' object has no attribute 'logits'
FAILED tests/models/test_checkpoint.py::test_run_converted_model[llama]@dependency_group_0 - AttributeError: 'BaseModelOutputWithPast' object has no attribute 'logits'
FAILED tests/models/test_checkpoint.py::test_run_converted_model[llama_mtp]@dependency_group_2 - AttributeError: 'BaseModelOutputWithPast' object has no attribute 'logits'
FAILED tests/models/test_checkpoint.py::test_run_converted_model[qwen2]@dependency_group_3 - AttributeError: 'BaseModelOutputWithPast' object has no attribute 'logits'
FAILED tests/models/test_checkpoint.py::test_run_converted_model[mistral]@dependency_group_4 - AttributeError: 'BaseModelOutputWithPast' object has no attribute 'logits'
Megatron seems due to the differences in my dev environment but others look legit?
@bigximik These are known failures not directly related to this PR.
|
bigximik
approved these changes
Jun 19, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
✨ Description
test_generate
is a bit different but still moved it there)🔍 Type of change
Select all that apply: