Skip to content
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

Add convergence tests and trainer integration test for Qwen2 #105

Merged
merged 4 commits into from
Aug 26, 2024

Conversation

Tcc0403
Copy link
Collaborator

@Tcc0403 Tcc0403 commented Aug 26, 2024

Summary

Discussion

Add convergence tests and trainer integration test for Qwen2

Details

Qwen2's config and parameters are copied from test_cross_entropy.py.

I also added qwen2 mock in test_apply_liger_kernel_only_supported_model_type_called just in case. But are we going to add every new models from now on?

Testing Done

I don't have a GPU with enough memory, only run test_trainer_integration.py and test_transformers_monkey_patch.py.
Need others to help with make test.

  • Hardware Type: RTX-3080-10G
  • run make test to ensure correctness
  • run make checkstyle to ensure code style
  • run make test-convergence to ensure convergence
❯ pytest test/transformers/test_transformers_monkey_patch.py
============================================ test session starts =============================================
platform linux -- Python 3.10.12, pytest-8.3.2, pluggy-1.5.0
rootdir: /home/tcc/Liger-Kernel
collected 1 item

test/transformers/test_transformers_monkey_patch.py .                                                  [100%]

============================================= 1 passed in 1.72s ==============================================
❯ pytest test/transformers/test_trainer_integration.py
============================================ test session starts =============================================
platform linux -- Python 3.10.12, pytest-8.3.2, pluggy-1.5.0
rootdir: /home/tcc/Liger-Kernel
collected 3 items

test/transformers/test_trainer_integration.py ...                                                      [100%]

============================================= 3 passed in 1.84s ==============================================
❯ make checkstyle
flake8 .; flake8_status=$?; \
isort .; isort_status=$?; \
black .; black_status=$?; \
if [ $flake8_status -ne 0 ] || [ $isort_status -ne 0 ] || [ $black_status -ne 0 ]; then \
        exit 1; \
fi
Skipped 2 files
All done! ✨ 🍰 ✨
52 files left unchanged.
❯ make test-convergence
HF_DATASETS_OFFLINE=1 pytest --disable-warnings test/convergence
============================================ test session starts =============================================
platform linux -- Python 3.10.12, pytest-8.3.2, pluggy-1.5.0
rootdir: /home/tcc/Liger-Kernel
collected 12 items

test/convergence/test_mini_models.py ........                                                          [ 66%]
test/convergence/test_mini_models_no_logits.py ....                                                    [100%]

======================================= 12 passed in 81.23s (0:01:21) ========================================

@ByronHsu
Copy link
Collaborator

Are you in discord? https://discord.gg/nSeNms8u. Please say hi!

ByronHsu
ByronHsu previously approved these changes Aug 26, 2024

with patch.dict(
MODEL_TYPE_TO_APPLY_LIGER_FN,
{"gemma": mock_gemma, "llama": mock_llama, "mistral": mock_mistral},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the test cannot scale. i will make a change.

@ByronHsu
Copy link
Collaborator

please solve the conflict

@Tcc0403
Copy link
Collaborator Author

Tcc0403 commented Aug 26, 2024

Solved the conflict and deleted qwen from integration test!

Copy link
Collaborator

@ByronHsu ByronHsu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @shivam15s to refactor the test to a for loop

@ByronHsu ByronHsu merged commit 728ec76 into linkedin:main Aug 26, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants