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

Revert "[SLM] Allow modules to define pre-processing of weights" #16777

Merged

Conversation

tqchen
Copy link
Member

@tqchen tqchen commented Mar 24, 2024

Reverts #16757

@Lunderberg
Copy link
Contributor

@tqchen Can you add a unit test demonstrating the behavior to be retained? Is it only for the string names of symbolic variables, as mentioned in this comment?

@tqchen
Copy link
Member Author

tqchen commented Mar 24, 2024

Likely i think it would be primarily two parameters with same vocab_size as the dynamic shape.

@tqchen
Copy link
Member Author

tqchen commented Mar 24, 2024

Happy to also test followup redos of the PR in case we miss other cases

@MasterJH5574
Copy link
Contributor

I replied with a test to the other PR before noticing the on-going thread here. #16757 (comment)

@tqchen so could you help pasting it into test_frontend_nn_modules.py? Then we don't need a separate PR for the test.

@MasterJH5574 MasterJH5574 merged commit ef46f4e into main Mar 25, 2024
19 checks passed
@MasterJH5574
Copy link
Contributor

Merged without the unit test to keep the reversion standalone. Let's add the test case separately. Thank you folks!

@Lunderberg
Copy link
Contributor

I have a parametrized version of the test case, along with testing for cases beyond nn.Linear, that I'll open as a PR.

Lunderberg added a commit to Lunderberg/tvm that referenced this pull request Mar 25, 2024
Follow-up to apache#16777, add unit tests
demonstrating desired behavior.
Lunderberg added a commit to Lunderberg/tvm that referenced this pull request Mar 25, 2024
Prior to this commit, the weights used by `nn.Module` instances were
required to be `nn.Parameter` instances.  This commit allows the
weights to instead be `nn.Tensor` instances, defined in terms of other
`nn.Parameter` weights.  This allows a model to define both the
original weights that would be present in an external
checkpoint (e.g. a Pytorch or Safetensors file), and the
pre-processing that should be performed on those weights.

This is a re-implementation of
apache#16757, which was reverted in
apache#16777.  The re-implementation
preserves the handling of dynamic shapes specified as python strings,
enabling the test cases that were added in
apache#16784.
@tqchen tqchen deleted the revert-16757-slm_allow_expressions_in_initialization branch March 29, 2024 12:18
Lunderberg added a commit that referenced this pull request Mar 29, 2024
* [SLM] Add unit tests for SLM to Relax exporter

Follow-up to #16777, add unit tests
demonstrating desired behavior.

* Updated docstrings based on review comment
thaisacs pushed a commit to thaisacs/tvm that referenced this pull request Apr 3, 2024
…che#16777)

Revert "[SLM] Allow modules to define pre-processing of weights (apache#16757)"

This reverts commit 1cccc3b.
thaisacs pushed a commit to thaisacs/tvm that referenced this pull request Apr 3, 2024
* [SLM] Add unit tests for SLM to Relax exporter

Follow-up to apache#16777, add unit tests
demonstrating desired behavior.

* Updated docstrings based on review comment
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.

3 participants