-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
15 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,22 @@ | ||
import fire | ||
import jax | ||
import ray | ||
|
||
from levanter.config import main as config_main | ||
from levanter.main.train_lm import main as train_lm_main | ||
|
||
|
||
ray.init() | ||
print(f"ray.available_resources(): {ray.available_resources()}") | ||
print(f"jax.device_count(): {jax.device_count()}") | ||
|
||
|
||
@ray.remote | ||
@ray.remote(resources={"TPU": 8}) | ||
def train_lm(config_path: str): | ||
config_main(train_lm_main)(args=[config_path]) | ||
|
||
|
||
def main(config_path: str): | ||
train_lm.remote(config_path) | ||
|
||
if __name__ == "__main__": | ||
fire.Fire(train_lm) | ||
fire.Fire(main) |