Commit 1e3a42a
Safely import optional python packages (#13936)
* Safely import nvidia-resiliency-ext package
The nvidia-resiliency-ext package is not compatible with Windows/MacOS
currently and cannot be installed directly on those platforms. Given the
number of nested imports in the nemo.collections.llm API, it will try and
automatically import the resliency package even if not used. Safely
importing the package allows all modules to be imported without blocking
on the resiliency package for incompatible platforms. This opens up
greater support on more platforms.
If the nvidia-resiliency-ext package is needed when these lines are called,
it will throw an import error only when directly called.
Signed-Off-By: Robert Clark <[email protected]>
* Safely import modelopt algorithms
The default modelopt model transforms rely on the modelopt package being
installed which is not available on all platforms. This module gets
auto-imported when importing the nemo.collections.llm module and will
fail on platforms that don't support modelopt, such as Windows and MacOS,
even if the package isn't used.
Safely importing the package should allow the toolkit to be runnable on
both Windows and MacOS in a minimal state, which increases its
functionality, especially while paired with NeMo-Run.
Signed-Off-By: Robert Clark <[email protected]>
* Apply isort and black reformatting
Signed-off-by: roclark <[email protected]>
---------
Signed-off-by: Robert Clark <[email protected]>
Signed-off-by: roclark <[email protected]>1 parent 1095d20 commit 1e3a42a
File tree
2 files changed
+11
-7
lines changed- nemo
- collections/llm/modelopt/speculative
- lightning
2 files changed
+11
-7
lines changedLines changed: 8 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
30 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| |||
0 commit comments