Skip to content

Conversation

@anton-l
Copy link
Member

@anton-l anton-l commented Oct 10, 2022

This adds an M1-specific workflow to run fast test for mps devices.

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Oct 10, 2022

The documentation is not available anymore as the PR was closed or merged.

@anton-l anton-l changed the title [WIP] Add Apple M1 tests Add Apple M1 tests Oct 11, 2022
@anton-l anton-l requested a review from pcuenca October 11, 2022 23:17
@anton-l
Copy link
Member Author

anton-l commented Oct 11, 2022

@pcuenca the tests are ready for inspection right in this PR :)

Note: [MPSTemporaryNDArray initWithDevice:descriptor:] Error: product of dimension sizes > 2**31' outright segfaults, so we might not check all tests if the number of such failures is more than the number of pytest workers (4).

OMP_NUM_THREADS: 8
MKL_NUM_THREADS: 8
PYTEST_TIMEOUT: 60
MPS_TORCH_VERSION: 1.13.0.dev20220830
Copy link
Member Author

Choose a reason for hiding this comment

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

This is where we pin the torch version with the latest fixes for mps

@patrickvonplaten
Copy link
Contributor

Looks very cool ! Feel free to merge whenever @anton-l - also fine if they fail for a bit on master and we fix step-by-step

@pcuenca
Copy link
Member

pcuenca commented Oct 17, 2022

Hi @anton-l !

I made a couple of changes:

  • Use the RC of the upcoming PyTorch 1.13.
  • Skip the test that crashed, added another one to test the attention layer that is compatible with MPS.
  • Skip some cuda tests on MPS.

However, AutoencoderKLTests.test_output_pretrained is still failing, I don't know the reason why.

Could you please take a look at my changes? I think we can merge with this one failure and I'll try to fix it in a couple days.

model.config.sample_size,
model.config.sample_size,
generator=torch.manual_seed(0),
generator=generator,
Copy link
Member

Choose a reason for hiding this comment

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

I think this was the original intention. Unfortunately it doesn't fix the failing test.

Copy link
Contributor

Choose a reason for hiding this comment

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

@anton-l I think this is the reason why some tests are currently failing on master - could you take a look?

@anton-l
Copy link
Member Author

anton-l commented Oct 17, 2022

Thank you @pcuenca, everything looks good!

@anton-l anton-l merged commit cca59ce into main Oct 17, 2022
@pcuenca pcuenca deleted the m1-tests branch October 17, 2022 18:44
kumquatexpress pushed a commit to harvestlabs/diffusers that referenced this pull request Oct 19, 2022
* [CI] Add Apple M1 tests

* setup-python

* python build

* conda install

* remove branch

* only 3.8 is built for osx-arm

* try fetching prebuilt tokenizers

* use user cache

* update shells

* Reports and cleanup

* -> MPS

* Disable parallel tests

* Better naming

* investigate worker crash

* return xdist

* restart

* num_workers=2

* still crashing?

* faulthandler for segfaults

* faulthandler for segfaults

* remove restarts, stop on segfault

* torch version

* change installation order

* Use pre-RC version of PyTorch.

To be updated when it is released.

* Skip crashing test on MPS, add new one that works.

* Skip cuda tests in mps device.

* Actually use generator in test.

I think this was a typo.

* make style

Co-authored-by: Pedro Cuenca <[email protected]>
prathikr pushed a commit to prathikr/diffusers that referenced this pull request Oct 26, 2022
* [CI] Add Apple M1 tests

* setup-python

* python build

* conda install

* remove branch

* only 3.8 is built for osx-arm

* try fetching prebuilt tokenizers

* use user cache

* update shells

* Reports and cleanup

* -> MPS

* Disable parallel tests

* Better naming

* investigate worker crash

* return xdist

* restart

* num_workers=2

* still crashing?

* faulthandler for segfaults

* faulthandler for segfaults

* remove restarts, stop on segfault

* torch version

* change installation order

* Use pre-RC version of PyTorch.

To be updated when it is released.

* Skip crashing test on MPS, add new one that works.

* Skip cuda tests in mps device.

* Actually use generator in test.

I think this was a typo.

* make style

Co-authored-by: Pedro Cuenca <[email protected]>
prathikr pushed a commit to prathikr/diffusers that referenced this pull request Oct 26, 2022
* [CI] Add Apple M1 tests

* setup-python

* python build

* conda install

* remove branch

* only 3.8 is built for osx-arm

* try fetching prebuilt tokenizers

* use user cache

* update shells

* Reports and cleanup

* -> MPS

* Disable parallel tests

* Better naming

* investigate worker crash

* return xdist

* restart

* num_workers=2

* still crashing?

* faulthandler for segfaults

* faulthandler for segfaults

* remove restarts, stop on segfault

* torch version

* change installation order

* Use pre-RC version of PyTorch.

To be updated when it is released.

* Skip crashing test on MPS, add new one that works.

* Skip cuda tests in mps device.

* Actually use generator in test.

I think this was a typo.

* make style

Co-authored-by: Pedro Cuenca <[email protected]>
prathikr pushed a commit to prathikr/diffusers that referenced this pull request Oct 26, 2022
* [CI] Add Apple M1 tests

* setup-python

* python build

* conda install

* remove branch

* only 3.8 is built for osx-arm

* try fetching prebuilt tokenizers

* use user cache

* update shells

* Reports and cleanup

* -> MPS

* Disable parallel tests

* Better naming

* investigate worker crash

* return xdist

* restart

* num_workers=2

* still crashing?

* faulthandler for segfaults

* faulthandler for segfaults

* remove restarts, stop on segfault

* torch version

* change installation order

* Use pre-RC version of PyTorch.

To be updated when it is released.

* Skip crashing test on MPS, add new one that works.

* Skip cuda tests in mps device.

* Actually use generator in test.

I think this was a typo.

* make style

Co-authored-by: Pedro Cuenca <[email protected]>
prathikr pushed a commit to prathikr/diffusers that referenced this pull request Oct 26, 2022
* [CI] Add Apple M1 tests

* setup-python

* python build

* conda install

* remove branch

* only 3.8 is built for osx-arm

* try fetching prebuilt tokenizers

* use user cache

* update shells

* Reports and cleanup

* -> MPS

* Disable parallel tests

* Better naming

* investigate worker crash

* return xdist

* restart

* num_workers=2

* still crashing?

* faulthandler for segfaults

* faulthandler for segfaults

* remove restarts, stop on segfault

* torch version

* change installation order

* Use pre-RC version of PyTorch.

To be updated when it is released.

* Skip crashing test on MPS, add new one that works.

* Skip cuda tests in mps device.

* Actually use generator in test.

I think this was a typo.

* make style

Co-authored-by: Pedro Cuenca <[email protected]>
PhaneeshB pushed a commit to nod-ai/diffusers that referenced this pull request Mar 1, 2023
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.

5 participants