-
Notifications
You must be signed in to change notification settings - Fork 31.4k
HF Trainer: ALST/Ulysses sequence parallelism integration via HF Accelerate #41832
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
cfee9c9
6e28ca8
86a09b9
bb902f9
c0e8e0d
101eaff
d8770d5
4f416a4
ce5e392
3ceaa94
607e166
211b6df
34b208c
816cc96
b3cbfb1
674db46
b12249a
4be7619
21ec5e5
bc32a16
a850a3a
0127933
a50c89c
5e29dd9
6ce745d
59972a3
f554277
0eef76f
c277586
8201150
854fd51
76ee3ad
083ca01
6929fb2
6ae2bb0
407f34a
363909b
8f62f14
6c5b00c
49c5ed7
4cafb9b
7c1abd5
58e4e13
d8d53c2
a05eb52
ad61079
3fd097d
e3d8eda
ef59f3e
59487a8
2444728
4f33c2f
7d09b28
2e52913
7a5c45e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,7 @@ | |
| import gc | ||
| import importlib | ||
| import inspect | ||
| import json | ||
| import logging | ||
| import multiprocessing | ||
| import os | ||
|
|
@@ -2005,14 +2006,12 @@ def get_env(self): | |
| paths = [self.repo_root_dir_str, self.src_dir_str] | ||
| if "/examples" in self.test_file_dir_str: | ||
| paths.append(self.examples_dir_str) | ||
| else: | ||
| paths.append(self.tests_dir_str) | ||
stas00 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| paths.append(env.get("PYTHONPATH", "")) | ||
|
|
||
| env["PYTHONPATH"] = ":".join(paths) | ||
| return env | ||
|
|
||
| def get_auto_remove_tmp_dir(self, tmp_dir=None, before=None, after=None): | ||
| def get_auto_remove_tmp_dir(self, tmp_dir=None, before=None, after=None, return_pathlib_obj=False): | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is a really old version. In the latest incarnation it always return a The latest version is here: https://github.com/stas00/ml-engineering/blob/master/testing/testing_utils.py If wanted you could switch to the latest version instead and adapt tests to simplify.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cc @ydshieh
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's much better for it to always return a |
||
| """ | ||
| Args: | ||
| tmp_dir (`string`, *optional*): | ||
|
|
@@ -2032,6 +2031,8 @@ def get_auto_remove_tmp_dir(self, tmp_dir=None, before=None, after=None): | |
| after (`bool`, *optional*): | ||
| If `True`, delete the `tmp_dir` at the end of the test if `False`, leave the `tmp_dir` and its contents | ||
| intact at the end of the test. | ||
| return_pathlib_obj (`bool`, *optional*): | ||
| If `True` will return a pathlib.Path object | ||
|
|
||
| Returns: | ||
| tmp_dir(`string`): either the same value as passed via *tmp_dir* or the path to the auto-selected tmp dir | ||
|
|
@@ -2078,7 +2079,7 @@ def get_auto_remove_tmp_dir(self, tmp_dir=None, before=None, after=None): | |
| # register for deletion | ||
| self.teardown_tmp_dirs.append(tmp_dir) | ||
|
|
||
| return tmp_dir | ||
| return Path(tmp_dir).resolve() if return_pathlib_obj else tmp_dir | ||
|
|
||
| def python_one_liner_max_rss(self, one_liner_str): | ||
| """ | ||
|
|
@@ -4076,3 +4077,13 @@ def use_one_line_repr(obj): | |
| cache[(id(obj), indent, mode, prefix)] = output | ||
|
|
||
| return output | ||
|
|
||
|
|
||
| def write_file(file, content): | ||
| with open(file, "w") as f: | ||
| f.write(content) | ||
|
|
||
|
|
||
| def read_json_file(file): | ||
| with open(file, "r") as fh: | ||
| return json.load(fh) | ||
Uh oh!
There was an error while loading. Please reload this page.