[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
c31a6e876d
commit
9af17e2aa5
1 changed files with 6 additions and 3 deletions
|
|
@ -2246,11 +2246,14 @@ def run_training_process(*, event_queue: Any, stop_queue: Any, config: dict) ->
|
|||
# UNSLOTH_NO_EXPANDABLE_SEGMENTS opt-out semantics as the library patch.
|
||||
try:
|
||||
import platform as _plat
|
||||
|
||||
_spark_smi = False
|
||||
if _plat.machine().lower() in ("aarch64", "arm64"):
|
||||
_smi = _sp.run(
|
||||
["nvidia-smi", "--query-gpu=name", "--format=csv,noheader"],
|
||||
capture_output = True, text = True, timeout = 5,
|
||||
capture_output = True,
|
||||
text = True,
|
||||
timeout = 5,
|
||||
)
|
||||
_names_u = (_smi.stdout or "").upper()
|
||||
_spark_smi = any(
|
||||
|
|
@ -2260,8 +2263,8 @@ def run_training_process(*, event_queue: Any, stop_queue: Any, config: dict) ->
|
|||
_conf = os.environ.get("PYTORCH_CUDA_ALLOC_CONF", "")
|
||||
if "expandable_segments" not in _conf:
|
||||
os.environ["PYTORCH_CUDA_ALLOC_CONF"] = (
|
||||
(_conf + "," if _conf else "") + "expandable_segments:True"
|
||||
)
|
||||
_conf + "," if _conf else ""
|
||||
) + "expandable_segments:True"
|
||||
except Exception:
|
||||
pass
|
||||
import torch as _torch_mem
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue