Commit 01232b9
authored
Fix TORCHAO_SKIP_LOADING_SO_FILES behavior (#3189)
**Summary:** Today, if users want to force skip loading the .so
files, they can pass in `TORCHAO_SKIP_LOADING_SO_FILES=1`.
However, if they pass in `TORCHAO_SKIP_LOADING_SO_FILES=0` or
`TORCHAO_SKIP_LOADING_SO_FILES=false`, we will still skip loading
these files. This commit fixes this behavior by:
1. Renaming this env var to `TORCHAO_FORCE_SKIP_LOADING_SO_FILES`
2. Only accepting value of "1" for this env var
**Test Plan:**
```
$ TORCHAO_FORCE_SKIP_LOADING_SO_FILES=1 python -c "import torchao"
Skipping import of cpp extensions due to TORCHAO_FORCE_SKIP_LOADING_SO_FILES=1
\# No effect
$ TORCHAO_FORCE_SKIP_LOADING_SO_FILES=0 python -c "import torchao"
$ TORCHAO_FORCE_SKIP_LOADING_SO_FILES=False python -c "import torchao"
$ TORCHAO_FORCE_SKIP_LOADING_SO_FILES=false python -c "import torchao"
```1 parent ed4cd34 commit 01232b9
1 file changed
+14
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
49 | 52 | | |
50 | | - | |
| 53 | + | |
51 | 54 | | |
52 | 55 | | |
53 | 56 | | |
| |||
83 | 86 | | |
84 | 87 | | |
85 | 88 | | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
90 | 98 | | |
91 | 99 | | |
92 | 100 | | |
| |||
0 commit comments