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

Replace references to thinc.backends.linalg in the parser #11292

Conversation

shadeMe
Copy link
Contributor

@shadeMe shadeMe commented Aug 10, 2022

Description

This PR replaces references to the vestigial thinc.backend.linalg module with CBlas calls and a local function. The aforementioned module will be removed once this PR is merged.

Types of change

Refactoring

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.

@shadeMe shadeMe added the feat / parser Feature: Dependency Parser label Aug 10, 2022
@shadeMe shadeMe requested a review from svlandeg August 10, 2022 14:29
@svlandeg svlandeg added the 🔜 v4.0 Related to upcoming v4.0 label Aug 11, 2022
@shadeMe
Copy link
Contributor Author

shadeMe commented Aug 11, 2022

Quick note about the failing tests: They continue to fail locally even without my changes 🤔 I'll see if I can fix it.

EDIT: PR for the fix.

@svlandeg svlandeg requested a review from danieldk August 17, 2022 16:23
Copy link
Contributor

@danieldk danieldk left a comment

Choose a reason for hiding this comment

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

Nice to have this replace by C BLAS calls. Did you run an evaluation to ensure that there is no regression parsing accuracy? (It all looks correct, but never bad to do a sanity check.)

@@ -561,3 +559,15 @@ cdef void _sum_state_features(CBlas cblas, float* output,
feature = &cached[idx]
saxpy(cblas)(O, one, <const float*>feature, 1, &output[b*O], 1)
token_ids += F

cdef inline int _arg_max(const float* scores, const int n_classes) nogil:
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably not for this PR, but we have other argmax implementations in spacy/ml/parser_model.pyx. It would be nice if they were somewhere together.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

spacy/ml/parser_model.pyx is no longer part of the parser codebase post-refactor, right? I can't find it in this branch anymore.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, right, I was looking at the wrong branch. There is another one in spacy/pipeline/_parser_internals/transition_system.pyx.

@shadeMe
Copy link
Contributor Author

shadeMe commented Aug 29, 2022

Did you run an evaluation to ensure that there is no regression parsing accuracy? (It all looks correct, but never bad to do a sanity check.)

Re-tested - can confirm that there is no regression in parsing accuracy.

@danieldk danieldk merged commit 582232b into explosion:feature/refactor-parser Aug 30, 2022
danieldk added a commit to danieldk/spaCy that referenced this pull request Dec 2, 2022
danieldk added a commit that referenced this pull request Dec 17, 2022
* Move `thinc.extra.search` to `spacy.pipeline._parser_internals`

Backport of:
#11317

Co-authored-by: Madeesh Kannan <[email protected]>

* Replace references to `thinc.backends.linalg` with `CBlas`

Backport of:
#11292

Co-authored-by: Madeesh Kannan <[email protected]>

* Use cross entropy from `thinc.legacy`

* Require thinc>=9.0.0.dev0,<9.1.0

Co-authored-by: Madeesh Kannan <[email protected]>
@shadeMe shadeMe deleted the refactor/replace-thinc-linalg-backend branch January 16, 2023 15:06
jordankanter pushed a commit to jordankanter/spaCy that referenced this pull request Mar 14, 2024
* Move `thinc.extra.search` to `spacy.pipeline._parser_internals`

Backport of:
explosion#11317

Co-authored-by: Madeesh Kannan <[email protected]>

* Replace references to `thinc.backends.linalg` with `CBlas`

Backport of:
explosion#11292

Co-authored-by: Madeesh Kannan <[email protected]>

* Use cross entropy from `thinc.legacy`

* Require thinc>=9.0.0.dev0,<9.1.0

Co-authored-by: Madeesh Kannan <[email protected]>
jordankanter pushed a commit to jordankanter/spaCy that referenced this pull request Mar 14, 2024
* Move `thinc.extra.search` to `spacy.pipeline._parser_internals`

Backport of:
explosion#11317

Co-authored-by: Madeesh Kannan <[email protected]>

* Replace references to `thinc.backends.linalg` with `CBlas`

Backport of:
explosion#11292

Co-authored-by: Madeesh Kannan <[email protected]>

* Use cross entropy from `thinc.legacy`

* Require thinc>=9.0.0.dev0,<9.1.0

Co-authored-by: Madeesh Kannan <[email protected]>
jordankanter pushed a commit to jordankanter/spaCy that referenced this pull request Mar 29, 2024
* Move `thinc.extra.search` to `spacy.pipeline._parser_internals`

Backport of:
explosion#11317

Co-authored-by: Madeesh Kannan <[email protected]>

* Replace references to `thinc.backends.linalg` with `CBlas`

Backport of:
explosion#11292

Co-authored-by: Madeesh Kannan <[email protected]>

* Use cross entropy from `thinc.legacy`

* Require thinc>=9.0.0.dev0,<9.1.0

Co-authored-by: Madeesh Kannan <[email protected]>
jordankanter pushed a commit to jordankanter/spaCy that referenced this pull request Apr 17, 2024
* Move `thinc.extra.search` to `spacy.pipeline._parser_internals`

Backport of:
explosion#11317

Co-authored-by: Madeesh Kannan <[email protected]>

* Replace references to `thinc.backends.linalg` with `CBlas`

Backport of:
explosion#11292

Co-authored-by: Madeesh Kannan <[email protected]>

* Use cross entropy from `thinc.legacy`

* Require thinc>=9.0.0.dev0,<9.1.0

Co-authored-by: Madeesh Kannan <[email protected]>
jordankanter pushed a commit to jordankanter/spaCy that referenced this pull request Apr 17, 2024
* Move `thinc.extra.search` to `spacy.pipeline._parser_internals`

Backport of:
explosion#11317

Co-authored-by: Madeesh Kannan <[email protected]>

* Replace references to `thinc.backends.linalg` with `CBlas`

Backport of:
explosion#11292

Co-authored-by: Madeesh Kannan <[email protected]>

* Use cross entropy from `thinc.legacy`

* Require thinc>=9.0.0.dev0,<9.1.0

Co-authored-by: Madeesh Kannan <[email protected]>
jordankanter pushed a commit to jordankanter/spaCy that referenced this pull request May 3, 2024
* Move `thinc.extra.search` to `spacy.pipeline._parser_internals`

Backport of:
explosion#11317

Co-authored-by: Madeesh Kannan <[email protected]>

* Replace references to `thinc.backends.linalg` with `CBlas`

Backport of:
explosion#11292

Co-authored-by: Madeesh Kannan <[email protected]>

* Use cross entropy from `thinc.legacy`

* Require thinc>=9.0.0.dev0,<9.1.0

Co-authored-by: Madeesh Kannan <[email protected]>
jordankanter pushed a commit to jordankanter/spaCy that referenced this pull request May 3, 2024
* Move `thinc.extra.search` to `spacy.pipeline._parser_internals`

Backport of:
explosion#11317

Co-authored-by: Madeesh Kannan <[email protected]>

* Replace references to `thinc.backends.linalg` with `CBlas`

Backport of:
explosion#11292

Co-authored-by: Madeesh Kannan <[email protected]>

* Use cross entropy from `thinc.legacy`

* Require thinc>=9.0.0.dev0,<9.1.0

Co-authored-by: Madeesh Kannan <[email protected]>
jordankanter pushed a commit to jordankanter/spaCy that referenced this pull request May 10, 2024
* Move `thinc.extra.search` to `spacy.pipeline._parser_internals`

Backport of:
explosion#11317

Co-authored-by: Madeesh Kannan <[email protected]>

* Replace references to `thinc.backends.linalg` with `CBlas`

Backport of:
explosion#11292

Co-authored-by: Madeesh Kannan <[email protected]>

* Use cross entropy from `thinc.legacy`

* Require thinc>=9.0.0.dev0,<9.1.0

Co-authored-by: Madeesh Kannan <[email protected]>
jordankanter pushed a commit to jordankanter/spaCy that referenced this pull request May 10, 2024
* Move `thinc.extra.search` to `spacy.pipeline._parser_internals`

Backport of:
explosion#11317

Co-authored-by: Madeesh Kannan <[email protected]>

* Replace references to `thinc.backends.linalg` with `CBlas`

Backport of:
explosion#11292

Co-authored-by: Madeesh Kannan <[email protected]>

* Use cross entropy from `thinc.legacy`

* Require thinc>=9.0.0.dev0,<9.1.0

Co-authored-by: Madeesh Kannan <[email protected]>
jordankanter pushed a commit to jordankanter/spaCy that referenced this pull request May 10, 2024
* Move `thinc.extra.search` to `spacy.pipeline._parser_internals`

Backport of:
explosion#11317

Co-authored-by: Madeesh Kannan <[email protected]>

* Replace references to `thinc.backends.linalg` with `CBlas`

Backport of:
explosion#11292

Co-authored-by: Madeesh Kannan <[email protected]>

* Use cross entropy from `thinc.legacy`

* Require thinc>=9.0.0.dev0,<9.1.0

Co-authored-by: Madeesh Kannan <[email protected]>
jordankanter pushed a commit to jordankanter/spaCy that referenced this pull request May 10, 2024
* Move `thinc.extra.search` to `spacy.pipeline._parser_internals`

Backport of:
explosion#11317

Co-authored-by: Madeesh Kannan <[email protected]>

* Replace references to `thinc.backends.linalg` with `CBlas`

Backport of:
explosion#11292

Co-authored-by: Madeesh Kannan <[email protected]>

* Use cross entropy from `thinc.legacy`

* Require thinc>=9.0.0.dev0,<9.1.0

Co-authored-by: Madeesh Kannan <[email protected]>
jordankanter pushed a commit to jordankanter/spaCy that referenced this pull request May 10, 2024
* Move `thinc.extra.search` to `spacy.pipeline._parser_internals`

Backport of:
explosion#11317

Co-authored-by: Madeesh Kannan <[email protected]>

* Replace references to `thinc.backends.linalg` with `CBlas`

Backport of:
explosion#11292

Co-authored-by: Madeesh Kannan <[email protected]>

* Use cross entropy from `thinc.legacy`

* Require thinc>=9.0.0.dev0,<9.1.0

Co-authored-by: Madeesh Kannan <[email protected]>
jordankanter pushed a commit to jordankanter/spaCy that referenced this pull request May 10, 2024
* Move `thinc.extra.search` to `spacy.pipeline._parser_internals`

Backport of:
explosion#11317

Co-authored-by: Madeesh Kannan <[email protected]>

* Replace references to `thinc.backends.linalg` with `CBlas`

Backport of:
explosion#11292

Co-authored-by: Madeesh Kannan <[email protected]>

* Use cross entropy from `thinc.legacy`

* Require thinc>=9.0.0.dev0,<9.1.0

Co-authored-by: Madeesh Kannan <[email protected]>
jordankanter pushed a commit to jordankanter/spaCy that referenced this pull request May 10, 2024
* Move `thinc.extra.search` to `spacy.pipeline._parser_internals`

Backport of:
explosion#11317

Co-authored-by: Madeesh Kannan <[email protected]>

* Replace references to `thinc.backends.linalg` with `CBlas`

Backport of:
explosion#11292

Co-authored-by: Madeesh Kannan <[email protected]>

* Use cross entropy from `thinc.legacy`

* Require thinc>=9.0.0.dev0,<9.1.0

Co-authored-by: Madeesh Kannan <[email protected]>
jordankanter pushed a commit to jordankanter/spaCy that referenced this pull request May 21, 2024
* Move `thinc.extra.search` to `spacy.pipeline._parser_internals`

Backport of:
explosion#11317

Co-authored-by: Madeesh Kannan <[email protected]>

* Replace references to `thinc.backends.linalg` with `CBlas`

Backport of:
explosion#11292

Co-authored-by: Madeesh Kannan <[email protected]>

* Use cross entropy from `thinc.legacy`

* Require thinc>=9.0.0.dev0,<9.1.0

Co-authored-by: Madeesh Kannan <[email protected]>
jordankanter pushed a commit to jordankanter/spaCy that referenced this pull request May 21, 2024
* Move `thinc.extra.search` to `spacy.pipeline._parser_internals`

Backport of:
explosion#11317

Co-authored-by: Madeesh Kannan <[email protected]>

* Replace references to `thinc.backends.linalg` with `CBlas`

Backport of:
explosion#11292

Co-authored-by: Madeesh Kannan <[email protected]>

* Use cross entropy from `thinc.legacy`

* Require thinc>=9.0.0.dev0,<9.1.0

Co-authored-by: Madeesh Kannan <[email protected]>
jordankanter pushed a commit to jordankanter/spaCy that referenced this pull request May 21, 2024
* Move `thinc.extra.search` to `spacy.pipeline._parser_internals`

Backport of:
explosion#11317

Co-authored-by: Madeesh Kannan <[email protected]>

* Replace references to `thinc.backends.linalg` with `CBlas`

Backport of:
explosion#11292

Co-authored-by: Madeesh Kannan <[email protected]>

* Use cross entropy from `thinc.legacy`

* Require thinc>=9.0.0.dev0,<9.1.0

Co-authored-by: Madeesh Kannan <[email protected]>
jordankanter pushed a commit to jordankanter/spaCy that referenced this pull request May 21, 2024
* Move `thinc.extra.search` to `spacy.pipeline._parser_internals`

Backport of:
explosion#11317

Co-authored-by: Madeesh Kannan <[email protected]>

* Replace references to `thinc.backends.linalg` with `CBlas`

Backport of:
explosion#11292

Co-authored-by: Madeesh Kannan <[email protected]>

* Use cross entropy from `thinc.legacy`

* Require thinc>=9.0.0.dev0,<9.1.0

Co-authored-by: Madeesh Kannan <[email protected]>
jordankanter pushed a commit to jordankanter/spaCy that referenced this pull request May 21, 2024
* Move `thinc.extra.search` to `spacy.pipeline._parser_internals`

Backport of:
explosion#11317

Co-authored-by: Madeesh Kannan <[email protected]>

* Replace references to `thinc.backends.linalg` with `CBlas`

Backport of:
explosion#11292

Co-authored-by: Madeesh Kannan <[email protected]>

* Use cross entropy from `thinc.legacy`

* Require thinc>=9.0.0.dev0,<9.1.0

Co-authored-by: Madeesh Kannan <[email protected]>
jordankanter pushed a commit to jordankanter/spaCy that referenced this pull request May 21, 2024
* Move `thinc.extra.search` to `spacy.pipeline._parser_internals`

Backport of:
explosion#11317

Co-authored-by: Madeesh Kannan <[email protected]>

* Replace references to `thinc.backends.linalg` with `CBlas`

Backport of:
explosion#11292

Co-authored-by: Madeesh Kannan <[email protected]>

* Use cross entropy from `thinc.legacy`

* Require thinc>=9.0.0.dev0,<9.1.0

Co-authored-by: Madeesh Kannan <[email protected]>
jordankanter pushed a commit to jordankanter/spaCy that referenced this pull request May 21, 2024
* Move `thinc.extra.search` to `spacy.pipeline._parser_internals`

Backport of:
explosion#11317

Co-authored-by: Madeesh Kannan <[email protected]>

* Replace references to `thinc.backends.linalg` with `CBlas`

Backport of:
explosion#11292

Co-authored-by: Madeesh Kannan <[email protected]>

* Use cross entropy from `thinc.legacy`

* Require thinc>=9.0.0.dev0,<9.1.0

Co-authored-by: Madeesh Kannan <[email protected]>
jordankanter pushed a commit to jordankanter/spaCy that referenced this pull request May 21, 2024
* Move `thinc.extra.search` to `spacy.pipeline._parser_internals`

Backport of:
explosion#11317

Co-authored-by: Madeesh Kannan <[email protected]>

* Replace references to `thinc.backends.linalg` with `CBlas`

Backport of:
explosion#11292

Co-authored-by: Madeesh Kannan <[email protected]>

* Use cross entropy from `thinc.legacy`

* Require thinc>=9.0.0.dev0,<9.1.0

Co-authored-by: Madeesh Kannan <[email protected]>
jordankanter pushed a commit to jordankanter/spaCy that referenced this pull request May 21, 2024
* Move `thinc.extra.search` to `spacy.pipeline._parser_internals`

Backport of:
explosion#11317

Co-authored-by: Madeesh Kannan <[email protected]>

* Replace references to `thinc.backends.linalg` with `CBlas`

Backport of:
explosion#11292

Co-authored-by: Madeesh Kannan <[email protected]>

* Use cross entropy from `thinc.legacy`

* Require thinc>=9.0.0.dev0,<9.1.0

Co-authored-by: Madeesh Kannan <[email protected]>
jordankanter pushed a commit to jordankanter/spaCy that referenced this pull request May 21, 2024
* Move `thinc.extra.search` to `spacy.pipeline._parser_internals`

Backport of:
explosion#11317

Co-authored-by: Madeesh Kannan <[email protected]>

* Replace references to `thinc.backends.linalg` with `CBlas`

Backport of:
explosion#11292

Co-authored-by: Madeesh Kannan <[email protected]>

* Use cross entropy from `thinc.legacy`

* Require thinc>=9.0.0.dev0,<9.1.0

Co-authored-by: Madeesh Kannan <[email protected]>
jordankanter pushed a commit to jordankanter/spaCy that referenced this pull request May 21, 2024
* Move `thinc.extra.search` to `spacy.pipeline._parser_internals`

Backport of:
explosion#11317

Co-authored-by: Madeesh Kannan <[email protected]>

* Replace references to `thinc.backends.linalg` with `CBlas`

Backport of:
explosion#11292

Co-authored-by: Madeesh Kannan <[email protected]>

* Use cross entropy from `thinc.legacy`

* Require thinc>=9.0.0.dev0,<9.1.0

Co-authored-by: Madeesh Kannan <[email protected]>
jordankanter pushed a commit to jordankanter/spaCy that referenced this pull request May 21, 2024
* Move `thinc.extra.search` to `spacy.pipeline._parser_internals`

Backport of:
explosion#11317

Co-authored-by: Madeesh Kannan <[email protected]>

* Replace references to `thinc.backends.linalg` with `CBlas`

Backport of:
explosion#11292

Co-authored-by: Madeesh Kannan <[email protected]>

* Use cross entropy from `thinc.legacy`

* Require thinc>=9.0.0.dev0,<9.1.0

Co-authored-by: Madeesh Kannan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat / parser Feature: Dependency Parser 🔜 v4.0 Related to upcoming v4.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants