Skip to content

Changes to transition to generic API for ops with weight prepacking#35010

Closed
kimishpatel wants to merge 12 commits intogh/kimishpatel/5/basefrom
gh/kimishpatel/5/head
Closed

Changes to transition to generic API for ops with weight prepacking#35010
kimishpatel wants to merge 12 commits intogh/kimishpatel/5/basefrom
gh/kimishpatel/5/head

Conversation

@kimishpatel
Copy link
Copy Markdown
Contributor

@kimishpatel kimishpatel commented Mar 19, 2020

Stack from ghstack:

semantics.

Summary:
This PR moves all the xnnpack specific interfces to a generic interface.
Accordingly removes xnnpac specific reference from API and some variable
names.
What has not yet changed:

TODO:
USE_XNNPACK is still used. This can be removed where no XNNPACK
specific things are done. e.g., RegisterOpContext.cpp and
xnnpack_rewrite.cpp.
Also the filename and structure also remains. Some of the generic class
definition can be moved non-XNNPACK specific folder.

Test Plan:
python test/test_xnnpack_integration.py

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: D20526416

semantics.

Summary:
This PR moves all the xnnpack specific interfces to a generic interface.
Accordingly removes xnnpac specific reference from API and some variable
names.
What has not yet changed:

TODO:
USE_XNNPACK is still used. This can be removed where no XNNPACK
specific things are done. e.g., RegisterOpContext.cpp and
xnnpack_rewrite.cpp.
Also the filename and structure also remains. Some of the generic class
definition can be moved non-XNNPACK specific folder.

Test Plan:
python test/test_xnnpack_integration.py

Reviewers:

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
@kimishpatel kimishpatel requested a review from apaszke as a code owner March 19, 2020 00:31
kimishpatel added a commit that referenced this pull request Mar 19, 2020
semantics.

Summary:
This PR moves all the xnnpack specific interfces to a generic interface.
Accordingly removes xnnpac specific reference from API and some variable
names.
What has not yet changed:

TODO:
USE_XNNPACK is still used. This can be removed where no XNNPACK
specific things are done. e.g., RegisterOpContext.cpp and
xnnpack_rewrite.cpp.
Also the filename and structure also remains. Some of the generic class
definition can be moved non-XNNPACK specific folder.

Test Plan:
python test/test_xnnpack_integration.py

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 01e11d3
Pull Request resolved: #35010
@facebook-github-bot facebook-github-bot added the oncall: jit Add this issue/PR to JIT oncall triage queue label Mar 19, 2020
@kimishpatel
Copy link
Copy Markdown
Contributor Author

To note: This PR has not yet done the following:
USE_XNNPACK is still used. This can be removed where no XNNPACK
specific things are done. e.g., RegisterOpContext.cpp and
xnnpack_rewrite.cpp.
Also the filename and structure also remains. Some of the generic class
definition can be moved non-XNNPACK specific folder.

Copy link
Copy Markdown
Collaborator

@dzhulgakov dzhulgakov left a comment

Choose a reason for hiding this comment

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

Looks like on the right track!

Why do you have many formatting changes? Is it different version of clang-format?

groups,
{},
{});
Tensor run(const ContextConv2D& context, const Tensor& input) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

maybe minor thing - but why no make it a method?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I kept how it was in the original diff TBH. Yes it can be a method and in this case it might make sense. I will just keep it a TODO for future refactoring instead of doing it in the diff.

return output.contiguous(input.suggest_memory_format());
}

c10::intrusive_ptr<xnnpack::Conv2dOpContext> Conv2dPrePack::operator()(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: you don't need this trampoline - you can register xnnpack::XNNPackConv2dOpContext::create_context directly with RegisterOps (it doesn't need to be a functor)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I tried that in the first diff itself and something I ran into that would not let me compile, cannot remember what. I will try again and see if there is a way around else report the error back here.


class LinearOpContext : public torch::jit::CustomClassHolder {
protected:
Tensor orig_weight_;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this duplicates all weights for serialization, I guess xnnpack doesn't have "unpack" method, does it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is correct. My plan was to have the weights set to null inside setstate conditioned on some flags such as lite_interpreter run etc., that ensure we will not be serializing this. Is that the right approach?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@dzhulgakov, so I think we dont need to use trampoline. However, given that we are doing all this to make a generic API, it makes sense to hide backend specific context creation behind something, which in this PR turns out to be just a trampoline. However I am gonna stack a PR on top of this which will check global context to see which engine we want to use for packing (for now xnnpack) and direct context creation appropriately. I will refactor this code so that both setstate method and PrePack op are directed to a common method for context creaton.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not sure what the right approach is here. If we set the weights to null, that means we can't re-save the model, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, but if we know we will not need to, e.g. when we know we are doing inference in lite interpreter, it should ok, right?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah, but what about people using the full JIT. This is okay for now, but we should keep thinking about better solutions.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Keeping the weights around is fine, we can gate freeing them with mobile interpreter flag indeed (we kind of do that for qnnpack on mobile I think).

@dr-ci
Copy link
Copy Markdown

dr-ci Bot commented Mar 19, 2020

💊 CircleCI build failures summary and remediations

As of commit 38e2eb4 (more details on the Dr. CI page):


None of the build failures appear to be your fault 💚


  • 2/2 broken upstream at merge base a100cf5 since Mar 21

    Please rebase on the viable/strict branch (expand for instructions)

    If your commit is newer than viable/strict, you can try basing on an older, stable commit:

    git fetch https://github.com/pytorch/pytorch viable/strict
    git rebase --onto FETCH_HEAD $(git merge-base origin/master HEAD)
    

    If your commit is older than viable/strict:

    git fetch https://github.com/pytorch/pytorch viable/strict
    git rebase FETCH_HEAD
    

    Check out the recency history of this "viable master" tracking branch.


🚧 2 upstream failures:

These were probably caused by upstream breakages:


This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions on the GitHub issue tracker.

This comment has been revised 31 times.

@kimishpatel
Copy link
Copy Markdown
Contributor Author

Why do you have many formatting changes? Is it different version of clang-format?

Possibly. I ended apply clang-format on all the files that I touched.

…repacking"

semantics.

Summary:
This PR moves all the xnnpack specific interfces to a generic interface.
Accordingly removes xnnpac specific reference from API and some variable
names.
What has not yet changed:

TODO:
USE_XNNPACK is still used. This can be removed where no XNNPACK
specific things are done. e.g., RegisterOpContext.cpp and
xnnpack_rewrite.cpp.
Also the filename and structure also remains. Some of the generic class
definition can be moved non-XNNPACK specific folder.

Test Plan:
python test/test_xnnpack_integration.py

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
kimishpatel added a commit that referenced this pull request Mar 19, 2020
semantics.

Summary:
This PR moves all the xnnpack specific interfces to a generic interface.
Accordingly removes xnnpac specific reference from API and some variable
names.
What has not yet changed:

TODO:
USE_XNNPACK is still used. This can be removed where no XNNPACK
specific things are done. e.g., RegisterOpContext.cpp and
xnnpack_rewrite.cpp.
Also the filename and structure also remains. Some of the generic class
definition can be moved non-XNNPACK specific folder.

Test Plan:
python test/test_xnnpack_integration.py

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 2143c10
Pull Request resolved: #35010
…repacking"

semantics.

Summary:
This PR moves all the xnnpack specific interfces to a generic interface.
Accordingly removes xnnpac specific reference from API and some variable
names.
What has not yet changed:

TODO:
USE_XNNPACK is still used. This can be removed where no XNNPACK
specific things are done. e.g., RegisterOpContext.cpp and
xnnpack_rewrite.cpp.
Also the filename and structure also remains. Some of the generic class
definition can be moved non-XNNPACK specific folder.

Test Plan:
python test/test_xnnpack_integration.py

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
…repacking"

semantics.

Summary:
This PR moves all the xnnpack specific interfces to a generic interface.
Accordingly removes xnnpac specific reference from API and some variable
names.
What has not yet changed:

TODO:
USE_XNNPACK is still used. This can be removed where no XNNPACK
specific things are done. e.g., RegisterOpContext.cpp and
xnnpack_rewrite.cpp.
Also the filename and structure also remains. Some of the generic class
definition can be moved non-XNNPACK specific folder.

Test Plan:
python test/test_xnnpack_integration.py

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
Copy link
Copy Markdown
Contributor

@dreiss dreiss left a comment

Choose a reason for hiding this comment

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

Formatting changes need to be in a separate diff. This is impossible to review asis.

@kimishpatel
Copy link
Copy Markdown
Contributor Author

Formatting changes need to be in a separate diff. This is impossible to review asis.

I shouldnt have run clang-format on this. This is going to take a while to fix.

…repacking"

semantics.

Summary:
This PR moves all the xnnpack specific interfces to a generic interface.
Accordingly removes xnnpac specific reference from API and some variable
names.
What has not yet changed:

TODO:
USE_XNNPACK is still used. This can be removed where no XNNPACK
specific things are done. e.g., RegisterOpContext.cpp and
xnnpack_rewrite.cpp.
Also the filename and structure also remains. Some of the generic class
definition can be moved non-XNNPACK specific folder.

Test Plan:
python test/test_xnnpack_integration.py

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
kimishpatel added a commit that referenced this pull request Mar 19, 2020
semantics.

Summary:
This PR moves all the xnnpack specific interfces to a generic interface.
Accordingly removes xnnpac specific reference from API and some variable
names.
What has not yet changed:

TODO:
USE_XNNPACK is still used. This can be removed where no XNNPACK
specific things are done. e.g., RegisterOpContext.cpp and
xnnpack_rewrite.cpp.
Also the filename and structure also remains. Some of the generic class
definition can be moved non-XNNPACK specific folder.

Test Plan:
python test/test_xnnpack_integration.py

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 3cdde9d
Pull Request resolved: #35010
…repacking"

semantics.

Summary:
This PR moves all the xnnpack specific interfces to a generic interface.
Accordingly removes xnnpac specific reference from API and some variable
names.
What has not yet changed:

TODO:
USE_XNNPACK is still used. This can be removed where no XNNPACK
specific things are done. e.g., RegisterOpContext.cpp and
xnnpack_rewrite.cpp.
Also the filename and structure also remains. Some of the generic class
definition can be moved non-XNNPACK specific folder.

Test Plan:
python test/test_xnnpack_integration.py

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
kimishpatel added a commit that referenced this pull request Mar 19, 2020
semantics.

Summary:
This PR moves all the xnnpack specific interfces to a generic interface.
Accordingly removes xnnpac specific reference from API and some variable
names.
What has not yet changed:

TODO:
USE_XNNPACK is still used. This can be removed where no XNNPACK
specific things are done. e.g., RegisterOpContext.cpp and
xnnpack_rewrite.cpp.
Also the filename and structure also remains. Some of the generic class
definition can be moved non-XNNPACK specific folder.

Test Plan:
python test/test_xnnpack_integration.py

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: b8aaea5
Pull Request resolved: #35010

class LinearOpContext : public torch::jit::CustomClassHolder {
protected:
Tensor orig_weight_;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah, but what about people using the full JIT. This is okay for now, but we should keep thinking about better solutions.

…repacking"

semantics.

Summary:
This PR moves all the xnnpack specific interfces to a generic interface.
Accordingly removes xnnpac specific reference from API and some variable
names.
What has not yet changed:

TODO:
USE_XNNPACK is still used. This can be removed where no XNNPACK
specific things are done. e.g., RegisterOpContext.cpp and
xnnpack_rewrite.cpp.
Also the filename and structure also remains. Some of the generic class
definition can be moved non-XNNPACK specific folder.

Test Plan:
python test/test_xnnpack_integration.py

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
…repacking"

semantics.

Summary:
This PR moves all the xnnpack specific interfces to a generic interface.
Accordingly removes xnnpac specific reference from API and some variable
names.
What has not yet changed:

TODO:
USE_XNNPACK is still used. This can be removed where no XNNPACK
specific things are done. e.g., RegisterOpContext.cpp and
xnnpack_rewrite.cpp.
Also the filename and structure also remains. Some of the generic class
definition can be moved non-XNNPACK specific folder.

Test Plan:
python test/test_xnnpack_integration.py

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
kimishpatel added a commit that referenced this pull request Mar 20, 2020
semantics.

Summary:
This PR moves all the xnnpack specific interfces to a generic interface.
Accordingly removes xnnpac specific reference from API and some variable
names.
What has not yet changed:

TODO:
USE_XNNPACK is still used. This can be removed where no XNNPACK
specific things are done. e.g., RegisterOpContext.cpp and
xnnpack_rewrite.cpp.
Also the filename and structure also remains. Some of the generic class
definition can be moved non-XNNPACK specific folder.

Also had to add BC test changes to whitelist the ops added.

Test Plan:
python test/test_xnnpack_integration.py

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 5ca10a0
Pull Request resolved: #35010
…repacking"

semantics.

Summary:
This PR moves all the xnnpack specific interfces to a generic interface.
Accordingly removes xnnpac specific reference from API and some variable
names.
What has not yet changed:

TODO:
USE_XNNPACK is still used. This can be removed where no XNNPACK
specific things are done. e.g., RegisterOpContext.cpp and
xnnpack_rewrite.cpp.
Also the filename and structure also remains. Some of the generic class
definition can be moved non-XNNPACK specific folder.

Test Plan:
python test/test_xnnpack_integration.py

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
…repacking"

semantics.

Summary:
This PR moves all the xnnpack specific interfces to a generic interface.
Accordingly removes xnnpac specific reference from API and some variable
names.
What has not yet changed:

TODO:
USE_XNNPACK is still used. This can be removed where no XNNPACK
specific things are done. e.g., RegisterOpContext.cpp and
xnnpack_rewrite.cpp.
Also the filename and structure also remains. Some of the generic class
definition can be moved non-XNNPACK specific folder.

Test Plan:
python test/test_xnnpack_integration.py

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
kimishpatel added a commit that referenced this pull request Mar 20, 2020
semantics.

Summary:
This PR moves all the xnnpack specific interfces to a generic interface.
Accordingly removes xnnpac specific reference from API and some variable
names.
What has not yet changed:

TODO:
USE_XNNPACK is still used. This can be removed where no XNNPACK
specific things are done. e.g., RegisterOpContext.cpp and
xnnpack_rewrite.cpp.
Also the filename and structure also remains. Some of the generic class
definition can be moved non-XNNPACK specific folder.

Also had to add BC test changes to whitelist the ops added.

Test Plan:
python test/test_xnnpack_integration.py

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 9d05d87
Pull Request resolved: #35010
…repacking"

semantics.

Summary:
This PR moves all the xnnpack specific interfces to a generic interface.
Accordingly removes xnnpac specific reference from API and some variable
names.
What has not yet changed:

TODO:
USE_XNNPACK is still used. This can be removed where no XNNPACK
specific things are done. e.g., RegisterOpContext.cpp and
xnnpack_rewrite.cpp.
Also the filename and structure also remains. Some of the generic class
definition can be moved non-XNNPACK specific folder.

Test Plan:
python test/test_xnnpack_integration.py

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
kimishpatel added a commit that referenced this pull request Mar 21, 2020
semantics.

Summary:
This PR moves all the xnnpack specific interfces to a generic interface.
Accordingly removes xnnpac specific reference from API and some variable
names.
What has not yet changed:

TODO:
USE_XNNPACK is still used. This can be removed where no XNNPACK
specific things are done. e.g., RegisterOpContext.cpp and
xnnpack_rewrite.cpp.
Also the filename and structure also remains. Some of the generic class
definition can be moved non-XNNPACK specific folder.

Also had to add BC test changes to whitelist the ops added.

Test Plan:
python test/test_xnnpack_integration.py

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: b55a94d
Pull Request resolved: #35010
…repacking"

semantics.

Summary:
This PR moves all the xnnpack specific interfces to a generic interface.
Accordingly removes xnnpac specific reference from API and some variable
names.
What has not yet changed:

TODO:
USE_XNNPACK is still used. This can be removed where no XNNPACK
specific things are done. e.g., RegisterOpContext.cpp and
xnnpack_rewrite.cpp.
Also the filename and structure also remains. Some of the generic class
definition can be moved non-XNNPACK specific folder.

Test Plan:
python test/test_xnnpack_integration.py

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
kimishpatel added a commit that referenced this pull request Mar 22, 2020
semantics.

Summary:
This PR moves all the xnnpack specific interfces to a generic interface.
Accordingly removes xnnpac specific reference from API and some variable
names.
What has not yet changed:

TODO:
USE_XNNPACK is still used. This can be removed where no XNNPACK
specific things are done. e.g., RegisterOpContext.cpp and
xnnpack_rewrite.cpp.
Also the filename and structure also remains. Some of the generic class
definition can be moved non-XNNPACK specific folder.

Also had to add BC test changes to whitelist the ops added.

Test Plan:
python test/test_xnnpack_integration.py

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: b75cb64
Pull Request resolved: #35010
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been merged in e1c092f.

1 similar comment
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been merged in e1c092f.

@jerryzh168
Copy link
Copy Markdown
Contributor

What's the plan? are we going to use this for quantized ops as well?

@kimishpatel
Copy link
Copy Markdown
Contributor Author

What's the plan? are we going to use this for quantized ops as well?

I don't think so. Changes are mainly to abstract away xnnpack specific namespace from ops and make it generic. For example if we want to use gpu as the backend instead of xnnpack.

@dreiss
Copy link
Copy Markdown
Contributor

dreiss commented Mar 23, 2020

What's the plan? are we going to use this for quantized ops as well?

Not my plan. Quantized ops need to have output scale/zero as part of the interface, so IMO they should follow this same pattern but be separate.

@jerryzh168
Copy link
Copy Markdown
Contributor

folding quantized prepack is pretty much the same I think: #35077

So is this for the non quantized use case only?

@jerryzh168
Copy link
Copy Markdown
Contributor

Oh sorry, it might be confusing, I'm just talking about prepack folding. Found this PR when after I rebase my PRs and see the name of FoldPrepackingOps is changed

@kimishpatel
Copy link
Copy Markdown
Contributor Author

Oh sorry, it might be confusing, I'm just talking about prepack folding. Found this PR when after I rebase my PRs and see the name of FoldPrepackingOps is changed

Not sure what you mean by FoldPrepackingOps name changed. Also the rest of the op registration namespace changed but that should not impact any JIT passes.

n->kind() == Symbol::fromQualString("prepacked::conv2d_clamp_prepack"));
};
FoldPrePackingOps(m, filter_fn, "xnnpack_prepack_folding");
PrePackingOpsFolder(m, filter_fn, "prepack_folding");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm talking about the function name is changed from FoldPrePackingOps to PrePackingOpsFolder, which leads me to the PR, but it is not important. I'm just trying to understand what is the use case this function is targeting, is this only for non-quantized prepacking ops?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Aah thanks for pointing out :). Shouldn't have changed that as part of this PR. But to answer your question, no. It should be generic as we had discussed originally when the PR for this pass was under review. It should still be a generally usable pass that is can be applied after freezing, regardless. However the naming either FoldPrePackingOps or PrePackingOpsFolder does suggest that it is for prepacking ops, including quantized. But I understand the concern, if that is the concern, that the naming may suggest that it is applied to ops that are in prepacked namespace even though that is not the case.

Copy link
Copy Markdown
Contributor

@jerryzh168 jerryzh168 Mar 23, 2020

Choose a reason for hiding this comment

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

Yeah the implementation is applicable to quantized ops as well. Do we want to do use the same function for quantized prepacking ops as well(since now it is changed to a generic function)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think that was the original plan, right? I dont think anything about that has changed, except naming. So I would say yes we should.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I mean yeah, I can use PrePackingOpsFolder to implement a pass to fold quantized ops.
My question is should we merge that to the current new FoldPrePackingOps here, or is this still function still just for xnnpack?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

resolved in chat, this is prepack folding for fp32 ops.

@facebook-github-bot facebook-github-bot deleted the gh/kimishpatel/5/head branch March 26, 2020 14:16
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
…ytorch#35010)

Summary:
Pull Request resolved: pytorch#35010

semantics.

This PR moves all the xnnpack specific interfces to a generic interface.
Accordingly removes xnnpac specific reference from API and some variable
names.
What has not yet changed:

TODO:
USE_XNNPACK is still used. This can be removed where no XNNPACK
specific things are done. e.g., RegisterOpContext.cpp and
xnnpack_rewrite.cpp.
Also the filename and structure also remains. Some of the generic class
definition can be moved non-XNNPACK specific folder.

Test Plan:
python test/test_xnnpack_integration.py

Imported from OSS

Differential Revision: D20526416

fbshipit-source-id: 2e1725345c44bbb26bdc448097a7384eca121387
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged oncall: jit Add this issue/PR to JIT oncall triage queue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants