Skip to content

Conversation

@danieldk
Copy link
Contributor

@danieldk danieldk commented May 9, 2022

Description

This is a backport of #10747 from the parser refactor branch. It eliminates the explicit calls to BLIS, instead using the saxpy/sgemm provided by the Ops implementation.

This allows us to use Accelerate in the parser on M1 Macs (with an updated thinc-apple-ops).

Performance of the de_core_news_lg pipe:

BLIS 0.7.0, no thinc-apple-ops:  6385 WPS
BLIS 0.7.0, thinc-apple-ops:    36455 WPS
BLIS 0.9.0, no thinc-apple-ops: 19188 WPS
BLIS 0.9.0, thinc-apple-ops:    36682 WPS
This PR, thinc-apple-ops:       38726 WPS

Performance of the de_core_news_lg pipe (only tok2vec -> parser):

BLIS 0.7.0, no thinc-apple-ops: 13907 WPS
BLIS 0.7.0, thinc-apple-ops:    73172 WPS
BLIS 0.9.0, no thinc-apple-ops: 41576 WPS
BLIS 0.9.0, thinc-apple-ops:    72569 WPS
This PR, thinc-apple-ops:       87061 WPS

Types of change

Enhancement, performance improvement.

Checklist

  • I confirm that I have the right to submit this contribution under the project's MIT license.
  • I ran the tests, and all new and existing tests passed.
  • My changes don't require a change to the documentation, or if they do, I've added all required information.

This is a backport of explosion#10747
from the parser refactor branch. It eliminates the explicit calls
to BLIS, instead using the saxpy/sgemm provided by the Ops
implementation.

This allows us to use Accelerate in the parser on M1 Macs (with
an updated thinc-apple-ops).

Performance of the de_core_news_lg pipe:

BLIS 0.7.0, no thinc-apple-ops:  6385 WPS
BLIS 0.7.0, thinc-apple-ops:    36455 WPS
BLIS 0.9.0, no thinc-apple-ops: 19188 WPS
BLIS 0.9.0, thinc-apple-ops:    36682 WPS
This PR, thinc-apple-ops:       38726 WPS

Performance of the de_core_news_lg pipe (only tok2vec -> parser):

BLIS 0.7.0, no thinc-apple-ops: 13907 WPS
BLIS 0.7.0, thinc-apple-ops:    73172 WPS
BLIS 0.9.0, no thinc-apple-ops: 41576 WPS
BLIS 0.9.0, thinc-apple-ops:    72569 WPS
This PR, thinc-apple-ops:       87061 WPS
@danieldk danieldk added enhancement Feature requests and improvements feat / parser Feature: Dependency Parser perf / speed Performance: speed plat / m1 Apple M1 architecture support labels May 9, 2022
@danieldk danieldk marked this pull request as draft May 9, 2022 15:21
@danieldk danieldk added the v3.4 Related to v3.4 label May 10, 2022
@danieldk danieldk marked this pull request as ready for review May 25, 2022 08:20
@danieldk
Copy link
Contributor Author

No more draft, this should work now with Richard's typing PR merged.

Copy link
Contributor

@shadeMe shadeMe left a comment

Choose a reason for hiding this comment

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

LGTM with just one minor nitpick.

@danieldk
Copy link
Contributor Author

@explosion-bot please test_gpu

@explosion-bot
Copy link
Collaborator

explosion-bot commented May 27, 2022

🪁 Successfully triggered build on Buildkite

URL: https://buildkite.com/explosion-ai/spacy-gpu-test-suite/builds/81

@danieldk danieldk merged commit 85dd2b6 into explosion:master May 27, 2022
@danieldk danieldk deleted the cblas-backport branch May 27, 2022 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Feature requests and improvements feat / parser Feature: Dependency Parser perf / speed Performance: speed plat / m1 Apple M1 architecture support v3.4 Related to v3.4

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants