-
-
Notifications
You must be signed in to change notification settings - Fork 895
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* make mlflow optional * fix xformers don't patch swiglu if xformers not working fix the check for xformers swiglu * fix install of xformers with extra index url for docker builds * fix docker build arg quoting
- Loading branch information
Showing
12 changed files
with
86 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,6 @@ hf_transfer | |
colorama | ||
numba | ||
numpy>=1.24.4 | ||
mlflow | ||
# qlora things | ||
evaluate==0.4.1 | ||
scipy | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,5 +82,8 @@ def parse_requirements(): | |
"auto-gptq": [ | ||
"auto-gptq==0.5.1", | ||
], | ||
"mlflow": [ | ||
"mlflow", | ||
], | ||
}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
"""MLFlow module for trainer callbacks""" | ||
import logging | ||
from shutil import copyfile | ||
from tempfile import NamedTemporaryFile | ||
from typing import TYPE_CHECKING | ||
|
||
import mlflow | ||
from transformers import TrainerCallback, TrainerControl, TrainerState | ||
|
||
from axolotl.utils.distributed import is_main_process | ||
|
||
if TYPE_CHECKING: | ||
from axolotl.core.trainer_builder import AxolotlTrainingArguments | ||
|
||
LOG = logging.getLogger("axolotl.callbacks") | ||
|
||
|
||
class SaveAxolotlConfigtoMlflowCallback(TrainerCallback): | ||
# pylint: disable=duplicate-code | ||
"""Callback to save axolotl config to mlflow""" | ||
|
||
def __init__(self, axolotl_config_path): | ||
self.axolotl_config_path = axolotl_config_path | ||
|
||
def on_train_begin( | ||
self, | ||
args: "AxolotlTrainingArguments", # pylint: disable=unused-argument | ||
state: TrainerState, # pylint: disable=unused-argument | ||
control: TrainerControl, | ||
**kwargs, # pylint: disable=unused-argument | ||
): | ||
if is_main_process(): | ||
try: | ||
with NamedTemporaryFile( | ||
mode="w", delete=False, suffix=".yml", prefix="axolotl_config_" | ||
) as temp_file: | ||
copyfile(self.axolotl_config_path, temp_file.name) | ||
mlflow.log_artifact(temp_file.name, artifact_path="") | ||
LOG.info( | ||
"The Axolotl config has been saved to the MLflow artifacts." | ||
) | ||
except (FileNotFoundError, ConnectionError) as err: | ||
LOG.warning(f"Error while saving Axolotl config to MLflow: {err}") | ||
return control |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters