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

feat: _do_annotate_conv_bn + _annotate_softmax #1

Merged
merged 2 commits into from
Feb 17, 2025
Merged

feat: _do_annotate_conv_bn + _annotate_softmax #1

merged 2 commits into from
Feb 17, 2025

Conversation

Dayof
Copy link
Member

@Dayof Dayof commented Feb 7, 2025

Motivation

Fix some torch limitations

_get_aten_graph_module_for_pattern receives this _conv_bn fn and call torch capture_pre_autograd_graph with it, but inside this torch function it has this following assert (torch/_export/__init__.py:147 ):

assert isinstance(f, torch.nn.Module), "Expected an nn.Module instance."

This PR encapsulates the callable as a torch.nn.Module so that it does no raises this problem.

Add softmax quantized op

There is no softmax included in the static op in ai-edge-torch nowadays, therefore we are adding _annotate_softmax so that we can convert a full int8 model that included a softmax as output layer.

@Dayof Dayof changed the title fix: _do_annotate_conv_bn fix: _do_annotate_conv_bn + _annotate_softmax Feb 14, 2025
@Dayof Dayof changed the title fix: _do_annotate_conv_bn + _annotate_softmax feat: _do_annotate_conv_bn + _annotate_softmax Feb 14, 2025
@Dayof Dayof merged commit a6a828a into main Feb 17, 2025
@Dayof Dayof deleted the fix/qat branch February 17, 2025 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants