This file contains hidden or 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
| #### | |
| # run with 'help' arg for usage. | |
| #### | |
| """ | |
| python3.8 -m venv .venv | |
| source .venv/bin/activate | |
| pip install --upgrade pip setuptools | |
| pip install -r requirements.txt |
This file contains hidden or 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
| def apply_reshard(pytree_params_in, pytree_params_out, shards_in, shards_out): | |
| def override_dtype(x): | |
| if x.dtype == np.dtype('V2'): | |
| x.dtype = jnp.bfloat16 | |
| return x | |
| def is_leaf(x): | |
| return type(x) == np.ndarray |