Conversation
The "." suffix that keeps "layers.1" from matching "layers.10" was also added to layer names such as "fc1" or "model.decoder.layers.0.fc1", so those entries matched nothing and the layers were quantized anyway. Only add the suffix when modules sit under the name. Signed-off-by: kwy404 <thekaway404@gmail.com>
Collaborator
|
/azp run Unit-Test-CUDA-AutoRound |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Root cause:
_resolve_layer_config_presetsappends a "." to everyignore_layersentry that ends with a digit, so thatlayers.1does not also matchlayers.10. Layer names can end with a digit too, for examplefc1/fc2in OPT and Phi, or a full name such asmodel.decoder.layers.0.fc1. Those entries becomefc1./model.decoder.layers.0.fc1., match no layer, and the layers are quantized anyway. The only hint is the warning "Layer name or regex 'fc1.' in layer_config does not match any supported layers". Full names likemodel.decoder.layers.0.fc1worked before #1553, which moved the suffix ahead of the exact name check.Fix: only append the "." when some module actually sits under that name (
name + "."occurs in a module name). Block names such aslayers.1keep the current behavior, and a layer whose own name ends with a digit is matched like any other name.Test:
test_layer_name_ending_with_digitintest/unit/common/utils/test_set_layer_config.pypassesignore_layers="fc1,layers.0.fc2"on the existing 12 block test model.assert 4 == 16forlayers.11.fc1, and the warning above is logged forfc1.andlayers.0.fc2..Type of Change
Bug fix
Related Issues
Follow up to #1553
Checklist Before Submitting
/azp run Unit-Test-CUDA-AutoRound.