File tree 2 files changed +13
-0
lines changed
2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,13 @@ In fact, `ltt` is `pip` with a few added options:
103
103
ltt install --pytorch-computation-backend=cu102 torch
104
104
```
105
105
106
+ Borrowing from the mutex packages that PyTorch provides for ` conda ` installations,
107
+ ` --cpuonly ` is available as shorthand for ` --pytorch-computation-backend=cu102 ` .
108
+
109
+ In addition, the computation backend to be installed can also be set through the
110
+ ` LTT_PYTORCH_COMPUTATION_BACKEND ` environment variable. It will only be honored in
111
+ case no CLI option for the computation backend is specified.
112
+
106
113
- By default, ` ltt ` installs stable PyTorch binaries. To install binaries from the
107
114
nightly, test, or LTS channels pass the ` --pytorch-channel ` option:
108
115
Original file line number Diff line number Diff line change 4
4
import functools
5
5
import itertools
6
6
import optparse
7
+ import os
7
8
import re
8
9
import sys
9
10
import unittest .mock
@@ -145,6 +146,11 @@ def from_pip_argv(cls, argv: List[str]):
145
146
}
146
147
elif opts .cpuonly :
147
148
cbs = {cb .CPUBackend ()}
149
+ elif "LTT_PYTORCH_COMPUTATION_BACKEND" in os .environ :
150
+ cbs = {
151
+ cb .ComputationBackend .from_str (string .strip ())
152
+ for string in os .environ ["LTT_PYTORCH_COMPUTATION_BACKEND" ].split ("," )
153
+ }
148
154
else :
149
155
cbs = cb .detect_compatible_computation_backends ()
150
156
You can’t perform that action at this time.
0 commit comments