Skip to content

Speed up embedding tests #1668

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 20 commits into from
Nov 25, 2024
Merged

Speed up embedding tests #1668

merged 20 commits into from
Nov 25, 2024

Conversation

dakinggg
Copy link
Collaborator

@dakinggg dakinggg commented Nov 24, 2024

Slowest tests before:

72.64s call     tests/models/llm_embed/test_llm_embedding.py::test_mpt_embedding_lm[flash-True]
67.93s call     tests/models/llm_embed/test_llm_embedding.py::test_mpt_embedding_lm[torch-True]
67.84s call     tests/models/llm_embed/test_llm_embedding.py::test_contrastive_loss[one_query_multiple_responses-torch-True]
67.66s call     tests/models/llm_embed/test_llm_embedding.py::test_contrastive_loss[one_query_multiple_responses-flash-True]
67.52s call     tests/models/llm_embed/test_llm_embedding.py::test_contrastive_loss[one_query_one_response-torch-True]
67.48s call     tests/models/llm_embed/test_llm_embedding.py::test_contrastive_loss[one_query_one_response-flash-True]
40.42s setup    tests/tp/test_tp_strategies.py::test_tp_train_with_moes[ffn-2]
34.22s call     tests/models/llm_embed/test_llm_embedding.py::test_contrastive_loss[one_query_multiple_responses-torch-False]
33.72s call     tests/models/llm_embed/test_llm_embedding.py::test_contrastive_loss[one_query_multiple_responses-flash-False]
33.41s call     tests/models/llm_embed/test_llm_embedding.py::test_contrastive_loss[one_query_one_response-flash-False]
33.37s call     tests/models/llm_embed/test_llm_embedding.py::test_mpt_embedding_lm[flash-False]
32.93s call     tests/models/llm_embed/test_llm_embedding.py::test_contrastive_loss[one_query_one_response-torch-False]
32.73s call     tests/models/llm_embed/test_llm_embedding.py::test_mpt_embedding_lm[torch-False]
23.31s call     tests/tp/test_tp_strategies.py::test_tp_train_with_one_gpu
17.43s call     tests/a_scripts/inference/test_convert_composer_to_hf.py::test_convert_and_generate[mptmoe-None]
14.04s call     tests/a_scripts/inference/test_convert_composer_to_hf.py::test_convert_and_generate_meta[False-scripts/train/yamls/pretrain/testing-moe.yaml]
13.86s call     tests/a_scripts/inference/test_convert_composer_to_hf.py::test_convert_and_generate_meta[True-scripts/train/yamls/pretrain/testing-moe.yaml]
10.22s call     tests/models/layers/test_dmoe.py::test_fwd_equal_dmoe[bf16-glu-512]
8.52s call     tests/models/layers/test_dmoe.py::test_fwd_equal_dmoe[fp32-glu-512]
7.68s call     tests/a_scripts/inference/test_convert_composer_to_hf.py::test_huggingface_conversion_callback_interval[3ba-2ba-4ba-2-2-True]

Slowest tests after:

40.43s setup    tests/tp/test_tp_strategies.py::test_tp_train_with_moes[ffn-2]
22.27s call     tests/tp/test_tp_strategies.py::test_tp_train_with_one_gpu
17.86s call     tests/a_scripts/inference/test_convert_composer_to_hf.py::test_convert_and_generate[mptmoe-None]
14.43s call     tests/a_scripts/inference/test_convert_composer_to_hf.py::test_convert_and_generate_meta[True-scripts/train/yamls/pretrain/testing-moe.yaml]
14.27s call     tests/a_scripts/inference/test_convert_composer_to_hf.py::test_convert_and_generate_meta[False-scripts/train/yamls/pretrain/testing-moe.yaml]
10.26s call     tests/models/layers/test_dmoe.py::test_fwd_equal_dmoe[bf16-glu-512]
8.85s call     tests/models/llm_embed/test_llm_embedding.py::test_contrastive_loss[one_query_multiple_responses-flash-False]
8.82s call     tests/models/llm_embed/test_llm_embedding.py::test_contrastive_loss[one_query_multiple_responses-torch-False]
8.55s call     tests/models/layers/test_dmoe.py::test_fwd_equal_dmoe[fp32-glu-512]
8.15s call     tests/a_scripts/inference/test_convert_composer_to_hf.py::test_huggingface_conversion_callback_interval[3ba-2ba-4ba-2-2-False]
8.07s call     tests/models/llm_embed/test_llm_embedding.py::test_contrastive_loss[one_query_one_response-torch-False]
7.86s call     tests/models/llm_embed/test_llm_embedding.py::test_mpt_embedding_lm[torch-False]
7.71s call     tests/a_scripts/inference/test_convert_composer_to_hf.py::test_huggingface_conversion_callback_interval[3ba-2ba-4ba-2-2-True]
7.56s call     tests/models/llm_embed/test_llm_embedding.py::test_contrastive_loss[one_query_one_response-flash-False]
7.47s call     tests/models/llm_embed/test_llm_embedding.py::test_mpt_embedding_lm[flash-False]
6.93s call     tests/a_scripts/inference/test_convert_composer_to_hf.py::test_huggingface_conversion_callback_interval[1dur-2ba-1ep-1-2-False]
6.72s call     tests/a_scripts/inference/test_convert_composer_to_hf.py::test_huggingface_conversion_callback_interval[1dur-2ba-1ep-1-2-True]
6.67s call     tests/models/layers/test_dmoe.py::test_fwd_equal_dmoe[bf16-mlp-512]
5.29s call     tests/a_scripts/inference/test_convert_composer_to_hf.py::test_final_register_only[None-False]
5.02s call     tests/models/hf/test_hf_mpt_gen.py::test_init_hfhub_mpt[flash-gpu]

@dakinggg dakinggg marked this pull request as ready for review November 25, 2024 20:58
@dakinggg dakinggg requested a review from a team as a code owner November 25, 2024 20:58
@dakinggg dakinggg enabled auto-merge (squash) November 25, 2024 20:58
Copy link
Contributor

@mvpatel2000 mvpatel2000 left a comment

Choose a reason for hiding this comment

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

@KuuCi when faster tests

@dakinggg dakinggg merged commit bd113da into mosaicml:main Nov 25, 2024
9 checks 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