Closed a-szegel closed 9 months ago
Same problem. I tried to deploy in us-west-2, and my EC2 AMI ID is ami-0763990f1c2645d21, AMI name is "Deep Learning AMI Neuron PyTorch 1.13.0 (Amazon Linux 2) 20230504"
And I also tried hf_pretrained_sd15_512_inference.ipynb, I got
module 'torch_neuronx' has no attribute 'async_load'
@Shellmode
The async_load
error you mentioned is due to a newer api call that's not supported until neuron release 2.12,0 (07/19), details: https://awsdocs-neuron.readthedocs-hosted.com/en/latest/release-notes/prev/rn.html#id5. Your ami is from a previous date 05/04, so it won't capture it.
Could you try updating your neuron package to a newer release (say 2.13.2)? https://awsdocs-neuron.readthedocs-hosted.com/en/latest/general/setup/neuron-setup/pytorch/neuronx/ubuntu/torch-neuronx-ubuntu20.html#get-started-with-latest-release-of-pytorch-neuron-torch-neuronx
python -m pip config set global.extra-index-url https://pip.repos.neuron.amazonaws.com
python -m pip install --force-reinstall neuronx-cc==2.* torch-neuronx torchvision
@a-szegel From your package, I can see your ami uses an earlier neuron release, Could you give a try on updating the packages? Similar steps as above
python -m pip config set global.extra-index-url https://pip.repos.neuron.amazonaws.com
python -m pip install --force-reinstall neuronx-cc==2.* torch-neuronx torchvision
between these two lines:
source /opt/aws_neuron_venv_pytorch/bin/activate jupyter nbconvert --to script hf_pretrained_sd2_512_inference.ipynb
Thank you! That fixes it. Is there anyway to have our blog posts/tutorials more accurately pin dependencies so they always work. Instead of the tutorial saying to clone main, we could clone a tag. In that tag, we can have a python requirements file that locks every dependency. We can also fix versions for non-python dependencies, so we don't get any surprises by AMI updates. I think it is very important that our examples work out of the box so people who are new to Graviton + ML have a positive experience.
@Shellmode The
async_load
error you mentioned is due to a newer api call that's not supported until neuron release 2.12,0 (07/19), details: https://awsdocs-neuron.readthedocs-hosted.com/en/latest/release-notes/prev/rn.html#id5. Your ami is from a previous date 05/04, so it won't capture it. Could you try updating your neuron package to a newer release (say 2.13.2)? https://awsdocs-neuron.readthedocs-hosted.com/en/latest/general/setup/neuron-setup/pytorch/neuronx/ubuntu/torch-neuronx-ubuntu20.html#get-started-with-latest-release-of-pytorch-neuron-torch-neuronxpython -m pip config set global.extra-index-url https://pip.repos.neuron.amazonaws.com python -m pip install --force-reinstall neuronx-cc==2.* torch-neuronx torchvision
Thanks, fixed.
Hello Everyone,
I am trying to follow the directions in https://aws.amazon.com/blogs/machine-learning/maximize-stable-diffusion-performance-and-lower-inference-costs-with-aws-inferentia2/. I am not sure what I am doing wrong and would love some help! Thanks in advance!
Simple Env
My environment looks as follows: instance: inf2.8xlarge ami:
aws ec2 describe-images --region us-west-2 --owners amazon --filters 'Name=name,Values=Deep Learning AMI Neuron PyTorch 1.13.? (Ubuntu 20.04) ????????' 'Name=state,Values=available' --query 'reverse(sort_by(Images, &CreationDate))[:1].ImageId' --output text
Error
PIP versions
Python Dependencies: