KEMBAR78
[MPS] Fix large copy by pytorchbot · Pull Request #126104 · pytorch/pytorch · GitHub
Skip to content

Conversation

@pytorchbot
Copy link
Collaborator

By slicing copyFromBuffer:sourceOffset:toBuffer:destinationOffset:size: into 2Gb chunks

Add regression test, but limit it to machines with 12Gb of RAM or more, and MacOS 14+, as on MacOS 13 attempt to alloc 4Gb tensor fails with:

/AppleInternal/Library/BuildRoots/c651a45f-806e-11ed-a221-7ef33c48bc85/Library/Caches/com.apple.xbs/Sources/MetalPerformanceShaders/MPSCore/Types/MPSNDArray.mm:724: failed assertion `[MPSNDArray initWithDevice:descriptor:] Error: total bytes of NDArray > 2**32'

Fixes #124335

By slicing `copyFromBuffer:sourceOffset:toBuffer:destinationOffset:size:` into 2Gb chunks

Add regression test, but limit it to machines with 12Gb of RAM or more, and MacOS 14+, as on MacOS 13 attempt to alloc 4Gb tensor fails with:
```
/AppleInternal/Library/BuildRoots/c651a45f-806e-11ed-a221-7ef33c48bc85/Library/Caches/com.apple.xbs/Sources/MetalPerformanceShaders/MPSCore/Types/MPSNDArray.mm:724: failed assertion `[MPSNDArray initWithDevice:descriptor:] Error: total bytes of NDArray > 2**32'
```

Fixes #124335

Pull Request resolved: #124635
Approved by: https://github.com/kulinseth

(cherry picked from commit abf3f90)
@pytorch-bot
Copy link

pytorch-bot bot commented May 13, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/126104

Note: Links to docs will display an error until the docs builds have been completed.

❌ 47 New Failures

As of commit fba7509 with merge base 86a2d67 (image):

NEW FAILURES - The following jobs have failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorch-bot pytorch-bot bot added ciflow/mps Run MPS tests (subset of trunk) release notes: mps Release notes category labels May 13, 2024
@huydhn
Copy link
Contributor

huydhn commented May 13, 2024

Merging now as MPS tests are passing

@huydhn huydhn merged commit 768e4b9 into release/2.3 May 13, 2024
@github-actions github-actions bot deleted the cherry-pick-124635-by-pytorch_bot_bot_ branch June 13, 2024 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/mps Run MPS tests (subset of trunk) open source release notes: mps Release notes category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants