let hf trainer handle torch compile (#516)

* let hf trainer handle torch compile

* remove torch compile checks, include option for backend

* suppress torch errors to get further

* require min torch version of 2.1.0 for torch compile to work

---------

Co-authored-by: Aman Karmani <aman@tmm1.net>
This commit is contained in:
Wing Lian
2023-09-13 11:42:12 -04:00
committed by GitHub
parent 36e53c7442
commit a4e1bb6606
3 changed files with 20 additions and 4 deletions

View File

@@ -80,10 +80,6 @@ def train(
model.config.use_cache = False
if torch.__version__ >= "2" and sys.platform != "win32":
LOG.info("Compiling torch model")
model = torch.compile(model)
# go ahead and presave, so we have the adapter config available to inspect
if peft_config:
LOG.info(f"Pre-saving adapter config to {cfg.output_dir}")