maxtext icon indicating copy to clipboard operation
maxtext copied to clipboard

Fix "~/xpk" references

Open lukebaumann opened this issue 8 months ago • 7 comments

          I tried making it `os.path.join(os.path.expanduser("~"), "directory")` in one of my earlier commits but that doesn't work. Explicitly someone made a mistake earlier on by not expanding `~` with [`os.path.expanduser`](https://docs.python.org/3/library/os.path.html#os.path.expanduser) so it actually expects in the maxtext directory a folder named `~` with the `xpk` folder inside. Otherwise the tests fail on CI.

Originally posted by @SamuelMarks in https://github.com/AI-Hypercomputer/maxtext/pull/1560#discussion_r2037944071

lukebaumann avatar Apr 10 '25 18:04 lukebaumann

There are references to an unexpanded tilde in benchmark runner files specifically

benchmark_runner.py pw_long_running_recipe.py maxtext_xpk_runner.py pw_mcjax_benchmark_recipe.py pw_mcjax_checkpoint_benchmark_recipe.py

@SamuelMarks were there other references that you are aware of?

lukebaumann avatar Apr 10 '25 19:04 lukebaumann

Is this solved now?

gobbleturk avatar Apr 17 '25 19:04 gobbleturk

I still count at least 7 relevant occurrences in main c32510d

I can send through a PR for this if you like; just didn't want to step on @bvandermoon's toes.

SamuelMarks avatar Apr 17 '25 19:04 SamuelMarks

@SamuelMarks @lukebaumann what is the issue with the ~? Generally the runners look for xpk to be present in the users's home directory at ~/xpk. For example the benchmark runner is working properly currently

bvandermoon avatar Apr 17 '25 20:04 bvandermoon

@bvandermoon Nothing is wrong with ~ but you can't just use it like that. That's why we see maxtext/~/xpk rather than /home/myname/xpk

$ python3 -c 'import os; print(os.path.expanduser("~"))'
/Users/myname
$ python3 -c 'import os; print("~")' 
~

Details of os.path.expanduser: https://docs.python.org/3/library/os.path.html#os.path.expanduser

SamuelMarks avatar Apr 17 '25 23:04 SamuelMarks

@bvandermoon there is an open PR as well, can we decide if any change is needed and close / merge accordingly ?

shralex avatar May 01 '25 13:05 shralex