Skip to content

Extract value_type-generic NEON Vectorized<Half> functions to CRTP base class #139084

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

Closed
wants to merge 13 commits into from

Conversation

…to CRTP base class

This is in prepraration for adding NEON Vectorized<BFloat16>, which will be simplified by sharing this stuff.

Differential Revision: [D64997744](https://our.internmc.facebook.com/intern/diff/D64997744/)

[ghstack-poisoned]
Copy link

pytorch-bot bot commented Oct 28, 2024

🔗 Helpful Links

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

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

✅ You can merge normally! (1 Unrelated Failure)

As of commit ecf3cbb with merge base 419a7e1 (image):

FLAKY - The following job failed but was likely due to flakiness present on trunk:

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

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D64997744

… functions to CRTP base class"

This is in prepraration for adding NEON Vectorized<BFloat16>, which will be simplified by sharing this stuff.

Differential Revision: [D64997744](https://our.internmc.facebook.com/intern/diff/D64997744/)

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D64997744

… functions to CRTP base class"

This is in prepraration for adding NEON Vectorized<BFloat16>, which will be simplified by sharing this stuff.

Differential Revision: [D64997744](https://our.internmc.facebook.com/intern/diff/D64997744/)

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D64997744

… functions to CRTP base class"

This is in prepraration for adding NEON Vectorized<BFloat16>, which will be simplified by sharing this stuff.

Differential Revision: [D64997744](https://our.internmc.facebook.com/intern/diff/D64997744/)

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D64997744

… functions to CRTP base class"

This is in prepraration for adding NEON Vectorized<BFloat16>, which will be simplified by sharing this stuff.

Differential Revision: [D64997744](https://our.internmc.facebook.com/intern/diff/D64997744/)

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D64997744

atalman pushed a commit to atalman/pytorch that referenced this pull request Nov 11, 2024
…torch#139558)

Discovered this bug when working on Vectorized<BFloat16>; apparently we have no automated testing for aarch64 without FP16.

Testing: Manually disable FP16 feature for local vec_test_all_types run on Mac; see pass.

Differential Revision: [D65385267](https://our.internmc.facebook.com/intern/diff/D65385267/)

Pull Request resolved: pytorch#139558
Approved by: https://github.com/malfet
ghstack dependencies: pytorch#139084, pytorch#139090
zero000064 pushed a commit to zero000064/pytorch that referenced this pull request Nov 14, 2024
…se class (pytorch#139084)

This is in prepraration for adding NEON Vectorized<BFloat16>, which will be simplified by sharing this stuff.

Differential Revision: [D64997744](https://our.internmc.facebook.com/intern/diff/D64997744/)

Pull Request resolved: pytorch#139084
Approved by: https://github.com/malfet
zero000064 pushed a commit to zero000064/pytorch that referenced this pull request Nov 14, 2024
When we have hardware support, we can use it. When we don't have hardware support, we can still do better than vec_base.h. I'm not sure to what extent we're set up to properly test both `defined(__ARM_FEATURE_BF16)` and `!defined(__ARM_FEATURE_BF16)` builds, feedback especially welcome there.

Testing: vec_test_all_types should cover correctness. For perf, seems clear that using vectorized intrinsics should be better than vec_base?

Differential Revision: [D64997747](https://our.internmc.facebook.com/intern/diff/D64997747/)

Pull Request resolved: pytorch#139090
Approved by: https://github.com/jgong5, https://github.com/malfet
ghstack dependencies: pytorch#139084
zero000064 pushed a commit to zero000064/pytorch that referenced this pull request Nov 14, 2024
…torch#139558)

Discovered this bug when working on Vectorized<BFloat16>; apparently we have no automated testing for aarch64 without FP16.

Testing: Manually disable FP16 feature for local vec_test_all_types run on Mac; see pass.

Differential Revision: [D65385267](https://our.internmc.facebook.com/intern/diff/D65385267/)

Pull Request resolved: pytorch#139558
Approved by: https://github.com/malfet
ghstack dependencies: pytorch#139084, pytorch#139090
zero000064 pushed a commit to zero000064/pytorch that referenced this pull request Nov 14, 2024
…rch#139081)

Following the previous move of fp16_gemv_trans.

Testing: Checked for performance regression with llm_benchmarks' `python benchmarks/benchmark_torch_mm.py llm`, didn't find one
Differential Revision: [D64930872](https://our.internmc.facebook.com/intern/diff/D64930872/)

Pull Request resolved: pytorch#139081
Approved by: https://github.com/malfet
ghstack dependencies: pytorch#139084, pytorch#139090, pytorch#139558
zero000064 pushed a commit to zero000064/pytorch that referenced this pull request Nov 14, 2024
zero000064 pushed a commit to zero000064/pytorch that referenced this pull request Nov 14, 2024
This is the big milestone for bf16 and should enable us to close pytorch/torchchat#1253 .

Testing: ran python torchchat.py generate llama3.2-1b --dtype bf16 --device cpu on x86 machine with AVX512-bf16. observed similar tokens/sec with and without MKL path hand-disabled. Also observed speedup from ~2.1 tok/sec to 7.4 tok/sec on x86 machine with only AVX2.

Differential Revision: [D65170967](https://our.internmc.facebook.com/intern/diff/D65170967/)
Pull Request resolved: pytorch#139220
Approved by: https://github.com/malfet
ghstack dependencies: pytorch#139084, pytorch#139090, pytorch#139558, pytorch#139081, pytorch#139208
pobin6 pushed a commit to pobin6/pytorch that referenced this pull request Dec 5, 2024
…se class (pytorch#139084)

This is in prepraration for adding NEON Vectorized<BFloat16>, which will be simplified by sharing this stuff.

Differential Revision: [D64997744](https://our.internmc.facebook.com/intern/diff/D64997744/)

Pull Request resolved: pytorch#139084
Approved by: https://github.com/malfet
pobin6 pushed a commit to pobin6/pytorch that referenced this pull request Dec 5, 2024
When we have hardware support, we can use it. When we don't have hardware support, we can still do better than vec_base.h. I'm not sure to what extent we're set up to properly test both `defined(__ARM_FEATURE_BF16)` and `!defined(__ARM_FEATURE_BF16)` builds, feedback especially welcome there.

Testing: vec_test_all_types should cover correctness. For perf, seems clear that using vectorized intrinsics should be better than vec_base?

Differential Revision: [D64997747](https://our.internmc.facebook.com/intern/diff/D64997747/)

Pull Request resolved: pytorch#139090
Approved by: https://github.com/jgong5, https://github.com/malfet
ghstack dependencies: pytorch#139084
pobin6 pushed a commit to pobin6/pytorch that referenced this pull request Dec 5, 2024
…torch#139558)

Discovered this bug when working on Vectorized<BFloat16>; apparently we have no automated testing for aarch64 without FP16.

Testing: Manually disable FP16 feature for local vec_test_all_types run on Mac; see pass.

Differential Revision: [D65385267](https://our.internmc.facebook.com/intern/diff/D65385267/)

Pull Request resolved: pytorch#139558
Approved by: https://github.com/malfet
ghstack dependencies: pytorch#139084, pytorch#139090
pobin6 pushed a commit to pobin6/pytorch that referenced this pull request Dec 5, 2024
…rch#139081)

Following the previous move of fp16_gemv_trans.

Testing: Checked for performance regression with llm_benchmarks' `python benchmarks/benchmark_torch_mm.py llm`, didn't find one
Differential Revision: [D64930872](https://our.internmc.facebook.com/intern/diff/D64930872/)

Pull Request resolved: pytorch#139081
Approved by: https://github.com/malfet
ghstack dependencies: pytorch#139084, pytorch#139090, pytorch#139558
pobin6 pushed a commit to pobin6/pytorch that referenced this pull request Dec 5, 2024
pobin6 pushed a commit to pobin6/pytorch that referenced this pull request Dec 5, 2024
This is the big milestone for bf16 and should enable us to close pytorch/torchchat#1253 .

Testing: ran python torchchat.py generate llama3.2-1b --dtype bf16 --device cpu on x86 machine with AVX512-bf16. observed similar tokens/sec with and without MKL path hand-disabled. Also observed speedup from ~2.1 tok/sec to 7.4 tok/sec on x86 machine with only AVX2.

Differential Revision: [D65170967](https://our.internmc.facebook.com/intern/diff/D65170967/)
Pull Request resolved: pytorch#139220
Approved by: https://github.com/malfet
ghstack dependencies: pytorch#139084, pytorch#139090, pytorch#139558, pytorch#139081, pytorch#139208
@github-actions github-actions bot deleted the gh/swolchok/680/head branch December 9, 2024 02:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/trunk Trigger trunk jobs on your pull request fb-exported Merged module: cpu CPU specific problem (e.g., perf, algorithm) topic: not user facing topic category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants