Commit 1a619a2
committed
fix(megatron): narrow the output_layer tiedness fallback to expected exceptions
Only two exceptions are anticipated when reading Megatron-LM's
untie_embeddings_and_output_weights: ImportError when megatron.training is
absent, and AssertionError when get_args() runs before initialize_megatron.
Anything else now propagates rather than silently downgrading to "tied", which
is the path that exports an unquantized output_layer.
Adds coverage for the uninitialized case, which had none.
Signed-off-by: James Shen <yueshen@nvidia.com>1 parent 8264fcb commit 1a619a2
2 files changed
Lines changed: 24 additions & 1 deletion
File tree
- modelopt/torch/quantization/plugins
- tests/gpu_megatron/torch/quantization/plugins
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
309 | 309 | | |
310 | 310 | | |
311 | 311 | | |
312 | | - | |
| 312 | + | |
| 313 | + | |
313 | 314 | | |
314 | 315 | | |
315 | 316 | | |
| |||
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1862 | 1862 | | |
1863 | 1863 | | |
1864 | 1864 | | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
| 1872 | + | |
| 1873 | + | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
| 1877 | + | |
| 1878 | + | |
| 1879 | + | |
| 1880 | + | |
| 1881 | + | |
| 1882 | + | |
| 1883 | + | |
| 1884 | + | |
| 1885 | + | |
| 1886 | + | |
1865 | 1887 | | |
1866 | 1888 | | |
1867 | 1889 | | |
| |||
0 commit comments