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

Fix Cohere CI #31263

Merged
merged 3 commits into from
Jun 10, 2024
Merged

Fix Cohere CI #31263

merged 3 commits into from
Jun 10, 2024

Conversation

ydshieh
Copy link
Collaborator

@ydshieh ydshieh commented Jun 5, 2024

What does this PR do?

Currently some tests are failing, see

https://github.com/huggingface/transformers/actions/runs/9360271371/job/25765482477

This PR skips 2 of them and make 4 pass:

FAILED tests/models/cohere/test_modeling_cohere.py::CohereModelTest::test_eager_matches_sdpa_generate - ValueError: Some modules are dispatched on the CPU or the disk. ..
FAILED tests/models/cohere/test_modeling_cohere.py::CohereIntegrationTest::test_batched_4bit - torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 88.00 MiB. GPU
FAILED tests/models/cohere/test_modeling_cohere.py::CohereIntegrationTest::test_batched_small_model_logits - RuntimeError: Half did not match Float
FAILED tests/models/cohere/test_tokenization_cohere.py::CohereTokenizationTest::test_torch_encode_plus_sent_to_model - RuntimeError: scaled_dot_product_attention_flash_attention does not support FP16 on the platforms without amx_fp16 support

Comment on lines 294 to 300
@unittest.skip("foo")
def test_initialization(self):
super().test_initialization()

@unittest.skip("foo")
def test_fast_init_context_manager(self):
super().test_fast_init_context_manager()
Copy link
Collaborator Author

@ydshieh ydshieh Jun 5, 2024

Choose a reason for hiding this comment

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

I will open issue to keep this track, but let's follow what we have discussed earlier that we sometimes also need to skip some tests considering the amount of time we have.

Comment on lines +384 to +387
"Hi there, here we are again with another great collection of free fonts for your next project. This time we have gathered 10 free fonts that you can download and use in your designs. These fonts are perfect for any kind",
]

model = CohereForCausalLM.from_pretrained(model_id)
model = CohereForCausalLM.from_pretrained(model_id, device_map="auto")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This was previously GPU OOM. After changing to auto, I have to update the expected output value too.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@ydshieh ydshieh force-pushed the fix_cohere branch 2 times, most recently from 761b75a to 06c81eb Compare June 6, 2024 13:44
Comment on lines +49 to +52
# This gives CPU OOM on a single-gpu runner (~60G RAM). On multi-gpu runner, it has ~180G RAM which is enough.
@require_torch_multi_gpu
def test_torch_encode_plus_sent_to_model(self):
super().test_torch_encode_plus_sent_to_model()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

CPU OOM

Comment on lines 294 to 301
@unittest.skip("Failing.")
def test_initialization(self):
super().test_initialization()

@unittest.skip("Failing.")
def test_fast_init_context_manager(self):
super().test_fast_init_context_manager()

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I will open issue to track this, but as we discussed earlier, let's not spend too much time on some tests and focus on other priorities.

Comment on lines +113 to +116
run: |
export CUDA_VISIBLE_DEVICES="$(python3 utils/set_cuda_devices_for_ci.py --test_folder ${{ matrix.folders }})"
echo $CUDA_VISIBLE_DEVICES
python3 -m pytest -v -rsfE --make-reports=${{ matrix.machine_type }}_run_models_gpu_${{ matrix.folders }}_test_reports tests/${{ matrix.folders }}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So far on workflow, we set CUDA_VISIBLE_DEVICES=0,1 as otherwise overall there are some more strange issues when running 4 GPUs.

However, for cohere test_eager_matches_sdpa_generate, it requires more GPU memory. So I just tried to allow CUDA_VISIBLE_DEVICES=0,1,2,3 for this job.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It requires a new script below (see at the end).

@ydshieh ydshieh requested a review from LysandreJik June 6, 2024 14:30
Copy link
Member

@LysandreJik LysandreJik left a comment

Choose a reason for hiding this comment

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

Ok, thanks Yih-Dar!

@ydshieh ydshieh merged commit 8fff07d into main Jun 10, 2024
22 of 24 checks passed
@ydshieh ydshieh deleted the fix_cohere branch June 10, 2024 13:16
zucchini-nlp pushed a commit to zucchini-nlp/transformers that referenced this pull request Jun 14, 2024
* [run-slow] cohere

* [run-slow] cohere

* [run-slow] cohere

---------

Co-authored-by: ydshieh <[email protected]>
itazap pushed a commit that referenced this pull request Jun 17, 2024
* [run-slow] cohere

* [run-slow] cohere

* [run-slow] cohere

---------

Co-authored-by: ydshieh <[email protected]>
itazap pushed a commit that referenced this pull request Jun 17, 2024
* [run-slow] cohere

* [run-slow] cohere

* [run-slow] cohere

---------

Co-authored-by: ydshieh <[email protected]>
itazap pushed a commit that referenced this pull request Jun 17, 2024
* [run-slow] cohere

* [run-slow] cohere

* [run-slow] cohere

---------

Co-authored-by: ydshieh <[email protected]>
itazap pushed a commit that referenced this pull request Jun 18, 2024
* [run-slow] cohere

* [run-slow] cohere

* [run-slow] cohere

---------

Co-authored-by: ydshieh <[email protected]>
@ydshieh ydshieh mentioned this pull request Jun 20, 2024
itazap pushed a commit that referenced this pull request Jun 20, 2024
* [run-slow] cohere

* [run-slow] cohere

* [run-slow] cohere

---------

Co-authored-by: ydshieh <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants