Repository navigation
Conversation
This branch has not been deployed
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.
Problem
StableEmbedding passes
deviceanddtypepositionally totorch.nn.Embedding. The parent signature now places_freezebefore these factory arguments, so an explicit device silently freezes the embedding weight, while an explicit dtype is interpreted as a device and raises a TypeError. Meta-device initialization also allocates the embedding on CPU instead of meta.Change
Forward the two existing factory arguments by keyword. No public arguments change. The normalization parameters retain their existing full-precision initialization.
Reproducer
Unchanged main fails the first assertion; constructing the explicitly typed layer separately raises
TypeError: empty(): argument 'device' must be torch.device, not torch.dtype.Validation
Base:
a616886cacf86701514f0cb1d6be760f967481c0; tested patch:42530450deaaef630f95a89bbeaac07a9118177c.tests/test_modules.pyon CPU: 110 passed, 2 skipped.git diff --checkpass.GPU/distributed execution and the complete repository suite were not run.
Checked all-state constructor/device/dtype/freeze issues and PRs, the module history, the latest 100 PRs and the user fork. #87 introduced the positional arguments; it does not address the later parent-signature change. #2132 fixes the separate forward normalization dtype problem. This patch is independently based on main and does not include or require #2132.