acoustic-van-30942
10/19/2023, 10:08 PMpytorch-cuda with just the @conda decorator
◦ Keep getting an error relating to not being able to install cudart
• I tried using the metaflow bleeding edge extensions and tried resolving the environment yml file i.e. (CONDA_OVERRIDE_CUDA=11.8 metaflow environment resolve --dry-run -f env.yml --python 3.10.1)
◦ But I get this error:
raise CondaException(
metaflow_extensions.netflix_ext.plugins.conda.utils.CondaException: Cannot resolve environments in mixed mode because no resolver is configuredflaky-plumber-70709
10/19/2023, 11:04 PMCONDA_MIXED_DEPENDENCY_RESOLVER not being set, can search for that in the repo readme - if your env.yml has both conda and pip dependencies you need to set that env variable to conda-lock (and have it installed in the env you're running metaflow in)acoustic-van-30942
10/19/2023, 11:04 PMdry-beach-38304
10/19/2023, 11:09 PMconda-lock . I can set it by default maybe. Initially I had disabled it because the mainline didn’t want it but now that it is an extension, it can just be enabled by default 🙂dry-beach-38304
10/19/2023, 11:09 PMacoustic-van-30942
10/19/2023, 11:14 PMname: t5
channels:
- pytorch
- conda-forge
- defaults
dependencies:
- pip
- metaflow
- pandas=1.5.3
- matplotlib=3.5.3
- pytorch-cuda=11.8
- torchvision=0.14.1
- pytorch-lightning=1.9.4
- sentencepiece=0.1.97
- scikit-learn=1.2.2acoustic-van-30942
10/19/2023, 11:14 PMResolving 1 environment ...Pretty-printed STDOUT:
Could not solve for environment specs
The following packages are incompatible
└─ pytorch-cuda 11.8 is uninstallable because there are no viable options
├─ pytorch-cuda 11.8 would require
│ └─ cuda-cudart >=11.8,<12.0 , which does not exist (perhaps a missing channel);
└─ pytorch-cuda 11.8 would require
└─ cuda 11.8.* , which does not exist (perhaps a missing channel).
{
"success": false
}
I tried installing cuda-cudart , but still errors outflaky-plumber-70709
10/19/2023, 11:16 PMacoustic-van-30942
10/19/2023, 11:16 PM11.8dry-beach-38304
10/19/2023, 11:17 PMdry-beach-38304
10/19/2023, 11:18 PMacoustic-van-30942
10/19/2023, 11:18 PMdry-beach-38304
10/19/2023, 11:20 PMdry-beach-38304
10/19/2023, 11:20 PMacoustic-van-30942
10/19/2023, 11:21 PMnvidia::pytorch-cuda a few months ago, but now mamba can't pick this up, so I removed it.dry-beach-38304
10/19/2023, 11:22 PMiname: t5
channels:
- pytorch
- conda-forge
- nvidia
dependencies:
- pandas=1.5.3
- matplotlib=3.5.3
- pytorch-cuda=11.8
- torchvision=0.14.1
- pytorch-lightning=1.9.4
- sentencepiece=0.1.97
- scikit-learn=1.2.2dry-beach-38304
10/19/2023, 11:23 PMacoustic-van-30942
10/19/2023, 11:24 PMdry-beach-38304
10/19/2023, 11:24 PMflaky-plumber-70709
10/19/2023, 11:26 PMacoustic-van-30942
10/19/2023, 11:26 PMacoustic-van-30942
10/19/2023, 11:27 PMpytorch-cuda :
Metaflow 2.10.3+netflix-ext(1.0.5) executing T5FSDPFlow for user:hunr592
Validating your flow...
The graph looks good!
Running pylint...
Pylint not found, so extra checks are disabled.
Bootstrapping Conda environment... (this could take a few minutes)
Resolving 1 environment ...Pretty-printed STDOUT:
Could not solve for environment specs
The following package could not be installed
└─ pytorch-cuda 11.8 does not exist (perhaps a typo or a missing channel).
{
"success": false
}acoustic-van-30942
10/19/2023, 11:28 PMconda_base :
@conda_base(
libraries={
"nvidia::pytorch-cuda": "11.8",
"pytorch::torchvision": "0.14.1",
"conda-forge::matplotlib": "3.5.3",
"conda-forge::sentencepiece": "0.1.97",
"conda-forge::pandas": "1.5.3",
"conda-forge::pytorch-lightning": "1.9.4",
"conda-forge::scikit-learn": "1.2.2"
},
python="3.10.1",
)flaky-plumber-70709
10/19/2023, 11:31 PMflaky-plumber-70709
10/19/2023, 11:33 PMflaky-plumber-70709
10/19/2023, 11:34 PMacoustic-van-30942
10/19/2023, 11:34 PMflaky-plumber-70709
10/19/2023, 11:35 PMacoustic-van-30942
10/19/2023, 11:35 PMconda resolver, but that leads to another set of errors. 😭flaky-plumber-70709
10/19/2023, 11:36 PMflaky-plumber-70709
10/19/2023, 11:37 PMflaky-plumber-70709
10/19/2023, 11:38 PMacoustic-van-30942
10/19/2023, 11:39 PMdry-beach-38304
10/20/2023, 12:33 AMdry-beach-38304
10/20/2023, 12:44 AM@conda_base(
libraries={
"pytorch::pytorch-cuda": "11.8",
"pytorch::torchvision": "0.14.1",
"conda-forge::matplotlib": "3.5.3",
"conda-forge::sentencepiece": "0.1.97",
"conda-forge::pandas": "1.5.3",
"conda-forge::pytorch-lightning": "1.9.4",
"conda-forge::scikit-learn": "1.2.2"},
channels=["nvidia"],
python="3.10.1",
)
or to have exactly what you had:
@conda_base(
libraries={
"pytorch-cuda": "11.8",
"torchvision": "0.14.1",
"matplotlib": "3.5.3",
"sentencepiece": "0.1.97",
"pandas": "1.5.3",
"pytorch-lightning": "1.9.4",
"scikit-learn": "1.2.2"},
channels=["nvidia", "pytorch"],
python="3.10.1",
)
For some reason (not sure why but probably internals of mamba), the second version seems to solve faster. The issue btw is that the nvidia channel is needed for the cuda-cudart package so you need to list that channel somewhere. As @flaky-plumber-70709 noted, the pytorch-cuda is no longer in the nvidia channel for some reason. Anyways, so I tested and this does work.acoustic-van-30942
10/20/2023, 1:44 AMacoustic-van-30942
10/20/2023, 2:05 AM2023-10-20 01:58:32.630 Workflow starting (run-id 23), see it in the UI at <https://d-khdgmtiq3x4i.studio.us-east-1.sagemaker.aws/jupyter/default/metaflow/T5FSDPFlow/23>
2023-10-20 01:58:32.929 Creating Conda environment ec19849b037e808f11118323f1b5be5c4762a101 (8082e5a9406467981ffcc4b61d7cb0659290b6cb)...
WARNING: conda/mamba do not properly handle installing .conda packages in offline mode. Creating environments may fail -- if so, please install `micromamba`. See <https://github.com/conda/conda/issues/11775>.
Extracting and linking Conda environment ...No STDOUT
Pretty-printed STDERR:
EnforceUnusedAdapter called with url <https://conda.anaconda.org/conda-forge/linux-64/libgcc-ng-13.2.0-h807b86a_2.conda>
This command is using a remote connection in offline mode.dry-beach-38304
10/20/2023, 2:17 AMacoustic-van-30942
10/20/2023, 2:18 AMacoustic-van-30942
10/20/2023, 2:21 AMconda config --env --add channels nvidia
There are some new issues that popped up though:
• torch.cuda.is_available() is returning False (even though I seemingly installed pytorch-cuda ).
• And it can't seem to find torchrun even though I installed pytorchflaky-plumber-70709
10/20/2023, 2:22 AMflaky-plumber-70709
10/20/2023, 2:24 AMacoustic-van-30942
10/20/2023, 2:24 AM@pip(
libraries={
"opencv_python_headless": "4.5.5.62"
}
)
@environment(
vars={
"EN_BATCH": os.getenv("EN_BATCH"),
"NVIDIA_DRIVER_CAPABILITIES": "compute,utility",
"CUDA_HOME": "/usr/local/cuda"
}
)acoustic-van-30942
10/20/2023, 2:25 AMpytorch-cuda to 11.6. Might be version incompatibilitydry-beach-38304
10/20/2023, 2:38 AMacoustic-van-30942
10/20/2023, 3:11 AMpytorch-cuda to 11.6 and now cuda is available.
The only remaining error is this:
No such file or directory: 'torchrun'acoustic-van-30942
10/20/2023, 4:20 AMsubprocess.run, it can't import the external dependencies from the virtual environment.
Tried downgrading to an older version of Metaflow 2.9.10, but get this error:
2023-10-20 04:43:19.017 [34/train/control-34-start-136 (pid 12480)] [0abdd5d8-bc98-40a5-897f-7b86bf7ab854] Code package downloaded.
2023-10-20 04:43:19.073 [34/train/control-34-start-136 (pid 12480)] [0abdd5d8-bc98-40a5-897f-7b86bf7ab854] Task is starting.
2023-10-20 04:43:19.705 [34/train/control-34-start-136 (pid 12480)] [0abdd5d8-bc98-40a5-897f-7b86bf7ab854] Bootstrapping virtual environment...
2023-10-20 04:43:19.705 [34/train/control-34-start-136 (pid 12480)] [0abdd5d8-bc98-40a5-897f-7b86bf7ab854] /usr/local/bin/python: Error while finding module specification for 'metaflow.plugins.pypi.bootstrap' (ModuleNotFoundError: No module named 'metaflow.plugins.pypi')dry-beach-38304
10/20/2023, 5:13 AMacoustic-van-30942
10/20/2023, 5:18 AMdry-beach-38304
10/20/2023, 5:19 AMacoustic-van-30942
10/20/2023, 5:20 AM@batchacoustic-van-30942
10/20/2023, 5:21 AMsubprocess to launch the distributed training job, but unfortunately, it cannot find torch or torchrun or any of the dependencies I specified in the @conda decoratordry-beach-38304
10/20/2023, 5:50 AMimport os
import subprocess
from metaflow import FlowSpec, conda, step
class TestSubprocess(FlowSpec):
@conda(libraries={"tree": ""})
@step
def start(self):
print("Got PATH as %s" % os.environ.get("PATH", "WTC"))
subprocess.run(["tree", "-L", "1", "/"])
self.next(self.end)
@step
def end(self):
print("All done")
if __name__ == "__main__":
TestSubprocess()
and when running python ./riley.py --environment=conda run --with batch, I get (relevant parts only):
2023-10-19 22:47:19.006 [280/start/5173 (pid 63715)] [6b1c62d7-5ff0-4ae1-96c3-64f564c2c352] Environment bootstrapped.
2023-10-19 22:47:19.765 [280/start/5173 (pid 63715)] [6b1c62d7-5ff0-4ae1-96c3-64f564c2c352] Got PATH as /root/micromamba/envs/metaflow_27bb27f9eeb1ec64a594a407adac09000a91214b_2529750338903c0626c8826c0d9ac72051344083/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
2023-10-19 22:47:19.767 [280/start/5173 (pid 63715)] [6b1c62d7-5ff0-4ae1-96c3-64f564c2c352] /
2023-10-19 22:47:19.767 [280/start/5173 (pid 63715)] [6b1c62d7-5ff0-4ae1-96c3-64f564c2c352] ├── bin -> usr/bin
2023-10-19 22:47:19.767 [280/start/5173 (pid 63715)] [6b1c62d7-5ff0-4ae1-96c3-64f564c2c352] ├── boot
2023-10-19 22:47:19.767 [280/start/5173 (pid 63715)] [6b1c62d7-5ff0-4ae1-96c3-64f564c2c352] ├── dev
2023-10-19 22:47:19.767 [280/start/5173 (pid 63715)] [6b1c62d7-5ff0-4ae1-96c3-64f564c2c352] ├── etc
2023-10-19 22:47:19.768 [280/start/5173 (pid 63715)] [6b1c62d7-5ff0-4ae1-96c3-64f564c2c352] ├── home
2023-10-19 22:47:19.768 [280/start/5173 (pid 63715)] [6b1c62d7-5ff0-4ae1-96c3-64f564c2c352] ├── lib -> usr/lib
2023-10-19 22:47:19.768 [280/start/5173 (pid 63715)] [6b1c62d7-5ff0-4ae1-96c3-64f564c2c352] ├── lib32 -> usr/lib32
2023-10-19 22:47:19.768 [280/start/5173 (pid 63715)] [6b1c62d7-5ff0-4ae1-96c3-64f564c2c352] ├── lib64 -> usr/lib64
2023-10-19 22:47:19.768 [280/start/5173 (pid 63715)] [6b1c62d7-5ff0-4ae1-96c3-64f564c2c352] ├── libx32 -> usr/libx32
2023-10-19 22:47:19.769 [280/start/5173 (pid 63715)] [6b1c62d7-5ff0-4ae1-96c3-64f564c2c352] ├── media
2023-10-19 22:47:19.769 [280/start/5173 (pid 63715)] [6b1c62d7-5ff0-4ae1-96c3-64f564c2c352] ├── metaflow
2023-10-19 22:47:19.769 [280/start/5173 (pid 63715)] [6b1c62d7-5ff0-4ae1-96c3-64f564c2c352] ├── mnt
2023-10-19 22:47:19.769 [280/start/5173 (pid 63715)] [6b1c62d7-5ff0-4ae1-96c3-64f564c2c352] ├── opt
2023-10-19 22:47:19.769 [280/start/5173 (pid 63715)] [6b1c62d7-5ff0-4ae1-96c3-64f564c2c352] ├── proc
2023-10-19 22:47:19.769 [280/start/5173 (pid 63715)] [6b1c62d7-5ff0-4ae1-96c3-64f564c2c352] ├── root
2023-10-19 22:47:19.769 [280/start/5173 (pid 63715)] [6b1c62d7-5ff0-4ae1-96c3-64f564c2c352] ├── run
2023-10-19 22:47:19.769 [280/start/5173 (pid 63715)] [6b1c62d7-5ff0-4ae1-96c3-64f564c2c352] ├── sbin -> usr/sbin
2023-10-19 22:47:19.770 [280/start/5173 (pid 63715)] [6b1c62d7-5ff0-4ae1-96c3-64f564c2c352] ├── srv
2023-10-19 22:47:19.770 [280/start/5173 (pid 63715)] [6b1c62d7-5ff0-4ae1-96c3-64f564c2c352] ├── sys
2023-10-19 22:47:19.770 [280/start/5173 (pid 63715)] [6b1c62d7-5ff0-4ae1-96c3-64f564c2c352] ├── tmp
2023-10-19 22:47:19.770 [280/start/5173 (pid 63715)] [6b1c62d7-5ff0-4ae1-96c3-64f564c2c352] ├── usr
2023-10-19 22:47:19.770 [280/start/5173 (pid 63715)] [6b1c62d7-5ff0-4ae1-96c3-64f564c2c352] └── var
2023-10-19 22:47:19.770 [280/start/5173 (pid 63715)] [6b1c62d7-5ff0-4ae1-96c3-64f564c2c352]
2023-10-19 22:47:19.770 [280/start/5173 (pid 63715)] [6b1c62d7-5ff0-4ae1-96c3-64f564c2c352] 23 directories, 0 files
and you can see that the PATH value seems to be set correctly.dry-beach-38304
10/20/2023, 5:51 AMacoustic-van-30942
10/20/2023, 5:58 AMdry-beach-38304
10/20/2023, 5:59 AMdry-beach-38304
10/20/2023, 6:00 AMacoustic-van-30942
10/20/2023, 6:00 AMdry-beach-38304
10/20/2023, 6:15 AMacoustic-van-30942
10/20/2023, 6:22 AMconda_base decorator? I have the experimental extension installed, but getting this error:
metaflow.exception.InvalidDecoratorAttribute: Decorator 'conda_base' does not support the attribute 'channels'. These attributes are supported: packages, libraries, python, disabled.dry-beach-38304
10/20/2023, 6:33 AMdry-beach-38304
10/20/2023, 6:33 AMdry-beach-38304
10/20/2023, 6:34 AMacoustic-van-30942
10/20/2023, 6:35 AMWarning: 'nvidia' already in 'channels' list, moving to the top
Metaflow 2.10.3+netflix-ext(1.0.5) executing T5FSDPFlow for user:hunracoustic-van-30942
10/20/2023, 6:35 AM2023-10-20 06:27:11.350 [39/train/control-39-start-154 (pid 2812)] Unknown step decorator:
2023-10-20 06:27:11.350 [39/train/control-39-start-154 (pid 2812)] Unknown step decorator conda_env_internal. The following decorators are supported: pytorch_parallel, pypi, metaflow_ray, secrets, environment, parallel, catch, retry, resources, timeout, conda, batch, card, kubernetesacoustic-van-30942
10/20/2023, 6:37 AMrm -rf .metaflowdry-beach-38304
10/20/2023, 6:45 AM.metaflow if you want but I would also do an uninstall of metaflow and the extension and reinstall both. I can further debug if you want (you can send me the log of METAFLOW_DEBUG_EXT=1 … but reinstall should fix it.acoustic-van-30942
10/20/2023, 6:46 AMdry-beach-38304
10/20/2023, 6:46 AMdry-beach-38304
10/20/2023, 6:58 AMdry-beach-38304
10/20/2023, 7:17 AMacoustic-van-30942
10/20/2023, 7:19 AMTraceback (most recent call last):
File "/home/sagemaker-user/metaflow_demos/src/fsdp-multi-node-multi-gpu/fsdp_flow.py", line 4, in <module>
from metaflow import (
File "/usr/local/lib/python3.11/site-packages/metaflow/__init__.py", line 54, in <module>
from metaflow.extension_support import (
File "/usr/local/lib/python3.11/site-packages/metaflow/extension_support/__init__.py", line 799, in <module>
_all_packages, _pkgs_per_extension_point = _get_extension_packages()
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/metaflow/extension_support/__init__.py", line 790, in _get_extension_packages
raise RuntimeError(
RuntimeError: Package at '/home/sagemaker-user/.local/lib/python3.11/site-packages/metaflow_extensions' does not define a configuration file for 'config'acoustic-van-30942
10/20/2023, 7:19 AMdry-beach-38304
10/20/2023, 7:22 AMdry-beach-38304
10/20/2023, 7:23 AMacoustic-van-30942
10/20/2023, 7:23 AMdry-beach-38304
10/20/2023, 7:28 AMMETAFLOW_DEBUG_EXT=1 python -c 'import metaflow'?acoustic-van-30942
10/20/2023, 7:34 AMacoustic-van-30942
10/20/2023, 7:40 AMdry-beach-38304
10/20/2023, 7:40 AMdry-beach-38304
10/20/2023, 7:40 AMacoustic-van-30942
10/20/2023, 7:40 AMdry-beach-38304
10/20/2023, 7:40 AMdry-beach-38304
10/20/2023, 7:41 AMdry-beach-38304
10/20/2023, 7:41 AMacoustic-van-30942
10/20/2023, 7:42 AMacoustic-van-30942
10/20/2023, 7:49 AMMetaflow 2.10.2+netflix-ext(1.0.6) executing T5FSDPFlow for user:hunr592
Validating your flow...
The graph looks good!
Running pylint...
Pylint not found, so extra checks are disabled.
Bootstrapping Conda environment... (this could take a few minutes)
All packages already cached in s3.
All environments already cached in s3.
Including file data/test.csv of size 3MB
Including file data/train.csv of size 25MB
Including file data/val.csv of size 3MB
2023-10-20 07:41:20.694 Workflow starting (run-id 45), see it in the UI at <https://d-khdgmtiq3x4i.studio.us-east-1.sagemaker.aws/jupyter/default/metaflow/T5FSDPFlow/45>
2023-10-20 07:41:20.937 Creating Conda environment 164cd1aff6018b43f3b03f0eff957621a88fe583 (2298fbd3713492c0d15cf783a145284dd622adb3)...
Downloading 0(web) + 208(cache) packages for arch linux-64 ... done in 228 seconds.
WARNING: conda/mamba do not properly handle installing .conda packages in offline mode (See <https://github.com/conda/conda/issues/11775>).
2023-10-20 07:45:12.977 Workflow failed.
2023-10-20 07:45:12.977 Terminating 0 active tasks...
2023-10-20 07:45:12.977 Flushing logs...
Internal error
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/metaflow/cli.py", line 1172, in main
start(auto_envvar_prefix="METAFLOW", obj=state)
File "/usr/local/lib/python3.11/site-packages/metaflow/_vendor/click/core.py", line 829, in __call__
return self.main(args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/metaflow/_vendor/click/core.py", line 782, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/metaflow/_vendor/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/metaflow/_vendor/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/metaflow/_vendor/click/core.py", line 610, in invoke
return callback(args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/metaflow/cli.py", line 691, in wrapper
return func(args, kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/metaflow/_vendor/click/decorators.py", line 33, in new_func
return f(get_current_context().obj, args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/metaflow/cli.py", line 850, in run
runtime.execute()
File "/usr/local/lib/python3.11/site-packages/metaflow/runtime.py", line 240, in execute
self._launch_workers()
File "/usr/local/lib/python3.11/site-packages/metaflow/runtime.py", line 646, in _launch_workers
self._launch_worker(task)
File "/usr/local/lib/python3.11/site-packages/metaflow/runtime.py", line 672, in _launch_worker
worker = Worker(task, self._max_log_size)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/metaflow/runtime.py", line 1183, in __init__
self._proc = self._launch()
^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/metaflow/runtime.py", line 1230, in _launch
deco.runtime_step_cli(
File "/home/sagemaker-user/.local/lib/python3.11/site-packages/metaflow_extensions/netflix_ext/plugins/conda/conda_step_decorator.py", line 525, in runtime_step_cli
conda.create_for_step(self._step_name, resolved_env),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sagemaker-user/.local/lib/python3.11/site-packages/metaflow_extensions/netflix_ext/plugins/conda/conda.py", line 380, in create_for_step
return self.create_for_name(env_name, env, do_symlink)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sagemaker-user/.local/lib/python3.11/site-packages/metaflow_extensions/netflix_ext/plugins/conda/conda.py", line 421, in create_for_name
env_path = self._create(env, name)
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sagemaker-user/.local/lib/python3.11/site-packages/metaflow_extensions/netflix_ext/plugins/conda/conda.py", line 2336, in _create
% self._bins["micromamba"]
~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'micromamba'dry-beach-38304
10/20/2023, 7:53 AMacoustic-van-30942
10/20/2023, 7:56 AMdry-beach-38304
10/20/2023, 7:58 AMacoustic-van-30942
10/20/2023, 8:04 AMFileNotFoundError: [Errno 2] No such file or directory: '/opt/conda/pkgs/nsight-compute-2023.3.0.12-0/info/repodata_record.json'dry-beach-38304
10/20/2023, 8:14 AMacoustic-van-30942
10/20/2023, 8:29 AMMetaflow 2.10.3+netflix-ext(1.0.7) executing T5FSDPFlow for user:hunr592
Validating your flow...
The graph looks good!
Running pylint...
Pylint not found, so extra checks are disabled.
Bootstrapping Conda environment... (this could take a few minutes)
Resolving 1 environment ... done in 23 seconds.
Downloading 159(web) + 0(cache) packages for arch linux-64 ... done in 31 seconds.
Caching 165 items to s3 ... done in 133 seconds.
Caching 2 environments and aliases to s3 ... done in 0 seconds.
Including file data/test.csv of size 3MB
Including file data/train.csv of size 25MB
Including file data/val.csv of size 3MB
2023-10-20 08:18:06.815 Workflow starting (run-id 1266), see it in the UI at <https://d-xxikydhjgmkz.studio.us-west-2.sagemaker.aws/jupyter/default/metaflow/T5FSDPFlow/1266>
2023-10-20 08:18:07.033 Creating Conda environment 164cd1aff6018b43f3b03f0eff957621a88fe583 (34625e4e745f6f968db3b9dddfdbd36e754f9112)...
Downloading 0(web) + 49(cache) packages for arch linux-64 ... done in 7 seconds.
WARNING: conda/mamba do not properly handle installing .conda packages in offline mode (See <https://github.com/conda/conda/issues/11775>).
Going to install micromamba to create environment ... installed at /home/sagemaker-user/.local/bin/micromamba
Extracting and linking Conda environment ... done in 582 seconds.
2023-10-20 08:28:00.271 [1266/start/6982 (pid 1765)] Task is starting.
2023-10-20 08:28:00.271 1 task is running: start (1 running; 0 done).
2023-10-20 08:28:00.271 No tasks are waiting in the queue.
2023-10-20 08:28:00.271 3 steps have not started: train, end, multinode_end.
2023-10-20 08:28:04.728 [1266/start/6982 (pid 1765)] No dot env!
2023-10-20 08:28:09.959 [1266/start/6982 (pid 1765)] Task finished successfully.
2023-10-20 08:28:10.802 [1266/train/control-1266-start-6982 (pid 1791)] Task is starting.
2023-10-20 08:28:11.874 [1266/train/control-1266-start-6982 (pid 1791)] Traceback (most recent call last):
2023-10-20 08:28:11.878 [1266/train/control-1266-start-6982 (pid 1791)] File "/home/sagemaker-user/metaflow_demos/src/fsdp-multi-node-multi-gpu/fsdp_flow.py", line 30, in <module>
2023-10-20 08:28:11.878 [1266/train/control-1266-start-6982 (pid 1791)] @conda_base(
2023-10-20 08:28:11.879 [1266/train/control-1266-start-6982 (pid 1791)] ^^^^^^^^^^^
2023-10-20 08:28:11.879 [1266/train/control-1266-start-6982 (pid 1791)] File "/usr/local/lib/python3.11/site-packages/metaflow/decorators.py", line 418, in wrap
2023-10-20 08:28:11.879 [1266/train/control-1266-start-6982 (pid 1791)] return _base_flow_decorator(decofunc, f, **kwargs)
2023-10-20 08:28:11.879 [1266/train/control-1266-start-6982 (pid 1791)] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-10-20 08:28:11.879 [1266/train/control-1266-start-6982 (pid 1791)] File "/usr/local/lib/python3.11/site-packages/metaflow/decorators.py", line 408, in _base_flow_decorator
2023-10-20 08:28:11.879 [1266/train/control-1266-start-6982 (pid 1791)] deco_instance = decofunc(attributes=kwargs, statically_defined=True)
2023-10-20 08:28:11.879 [1266/train/control-1266-start-6982 (pid 1791)] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-10-20 08:28:11.879 [1266/train/control-1266-start-6982 (pid 1791)] File "/usr/local/lib/python3.11/site-packages/metaflow/plugins/pypi/conda_decorator.py", line 301, in __init__
2023-10-20 08:28:11.880 [1266/train/control-1266-start-6982 (pid 1791)] super(CondaFlowDecorator, self).__init__(attributes, statically_defined)
2023-10-20 08:28:11.880 [1266/train/control-1266-start-6982 (pid 1791)] File "/usr/local/lib/python3.11/site-packages/metaflow/decorators.py", line 185, in __init__
2023-10-20 08:28:11.880 [1266/train/control-1266-start-6982 (pid 1791)] super(FlowDecorator, self).__init__(*args, **kwargs)
2023-10-20 08:28:11.993 [1266/train/control-1266-start-6982 (pid 1791)] File "/usr/local/lib/python3.11/site-packages/metaflow/decorators.py", line 123, in __init__
2023-10-20 08:28:11.994 [1266/train/control-1266-start-6982 (pid 1791)] raise InvalidDecoratorAttribute(self.name, k, self.defaults)
2023-10-20 08:28:11.994 [1266/train/control-1266-start-6982 (pid 1791)] metaflow.exception.InvalidDecoratorAttribute: Decorator 'conda_base' does not support the attribute 'channels'. These attributes are supported: packages, libraries, python, disabled.
2023-10-20 08:28:12.149 [1266/train/control-1266-start-6982 (pid 1791)] Task failed.
2023-10-20 08:28:12.307 Workflow failed.
2023-10-20 08:28:12.307 Terminating 0 active tasks...
2023-10-20 08:28:12.307 Flushing logs...acoustic-van-30942
10/20/2023, 8:39 AMmetaflow-ray extension. Will do that tomorrow 🙂dry-beach-38304
10/20/2023, 8:54 AMdry-beach-38304
10/20/2023, 8:55 AMacoustic-van-30942
10/20/2023, 4:35 PMdry-beach-38304
10/20/2023, 4:35 PMacoustic-van-30942
10/20/2023, 4:37 PMmetaflow-ray package which was pre-baked inside the custom kernel image was interfering with the experimental metaflow extension package?dry-beach-38304
10/20/2023, 4:39 PM__init__.py file to something like mfextinit_ray.py. That may be causing the issuedry-beach-38304
10/20/2023, 4:40 PM__init__.py files don’t always play nice with namespace packages (which is what Metaflow Extensions uses).acoustic-van-30942
10/20/2023, 4:40 PMdry-beach-38304
10/20/2023, 4:40 PMacoustic-van-30942
10/20/2023, 4:41 PMdry-beach-38304
10/20/2023, 4:41 PMdry-beach-38304
10/20/2023, 4:41 PMmfextinit_crooked-jordan-29960
10/20/2023, 6:18 PM_init_.py --> mfextinit_ray.py the same workflows that were good before are producing:
Traceback (most recent call last):
File "/Users/eddie/Dev/metaflow-ray/examples/cloud-dependencies/ray_cpu_multinode.py", line 1, in <module>
from metaflow import FlowSpec, step, metaflow_ray, batch, current
File "/Users/eddie/mambaforge/envs/new-mf-ray/lib/python3.12/site-packages/metaflow/__init__.py", line 115, in <module>
from .plugins.datatools import S3
File "/Users/eddie/mambaforge/envs/new-mf-ray/lib/python3.12/site-packages/metaflow/plugins/__init__.py", line 132, in <module>
STEP_DECORATORS = resolve_plugins("step_decorator")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/eddie/mambaforge/envs/new-mf-ray/lib/python3.12/site-packages/metaflow/extension_support/plugins.py", line 144, in resolve_plugins
raise ValueError(
ValueError: Cannot locate 'RayParallelDecorator' class for step_decorator plugin at 'metaflow_extensions.ray.plugins'
cc @acoustic-van-30942dry-beach-38304
10/20/2023, 6:18 PMdry-beach-38304
10/20/2023, 6:20 PMdry-beach-38304
10/20/2023, 6:27 PMcrooked-jordan-29960
10/20/2023, 6:30 PMdry-beach-38304
10/20/2023, 6:32 PMcrooked-jordan-29960
10/20/2023, 6:40 PMacoustic-van-30942
10/20/2023, 6:40 PMdry-beach-38304
10/20/2023, 6:47 PM__init__.py files but if you are sure that nothing else will be added to that directory when the namespace packages are installed (they are all installed in the same place in some cases).dry-beach-38304
10/20/2023, 6:47 PMdry-beach-38304
10/20/2023, 6:47 PMcrooked-jordan-29960
10/20/2023, 6:48 PMdry-beach-38304
10/20/2023, 6:49 PM.RayDecorator no longer pointed to anything since there was no __init__.py 🙂dry-beach-38304
10/20/2023, 7:26 PMacoustic-van-30942
10/20/2023, 7:28 PMdry-beach-38304
10/20/2023, 7:29 PMacoustic-van-30942
10/20/2023, 7:31 PMenv.yml , and I stopped doing that recently.acoustic-van-30942
10/20/2023, 7:31 PMdry-beach-38304
10/20/2023, 7:35 PMmetaflow_ray decorator, instead of inheriting from just StepDecorator, do this:
from metaflow_extensions.netflix_ext.plugins.conda.conda_common_decorator import StepRequirementMixin
class RayParallelDecorator(StepRequirementMixin, ParallelDecorator):
• and then just add this method to your class:
def default_disabled(self, ubf_context: str) -> Optional[bool]:
return False
One way this may change (I don’t currently have a need for it but could evolve) is that instead of this method (or in addition), I would pass the requirements the user has to a function that would change it to something else based on ubf_context. This is a bit hacky rn but it does work (we have a different ray integration but some of the issues were the same).acoustic-van-30942
10/20/2023, 7:37 PMdry-beach-38304
10/20/2023, 7:38 PMdry-beach-38304
10/20/2023, 7:38 PMacoustic-van-30942
10/20/2023, 7:39 PMmetaflow_ray decorator