You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I also setup the ROCm + Vicuna development environment using a Nix flake, but there are a few more tweaks I want to make before publishing it (eg. writing Nix packages for accelerate and gradio).
🎉 I managed to this running on my RX 7900 XTX!! I just tracked down all the development commits that added gfx11 support to ROCm built it all from source.
I can confirm fastchat with vicuna 13b model runs fine with 8bit mode on a single AMD 6800 card. SYSTEM: Ubuntu 20 LTS, installed rocm 5.4.2, then pytorch with rocm 5.4.2 support. No need to build from source, works directly with all official packages.
Oh yep sorry, for all other supported AMD cards you shouldn't need to build from source. I only had to because the RX 7900 XTX isn't supported in the release builds of ROCm yet.
@aseok Oh nope! It was only necessary before the 5.5 ROCm release to support gfx1100.
Although... there are still some problems in nixpkgs that means there are parts that you still have to compile from source if you want to use the flake: (see NixOS/nixpkgs#230881) - right now the builder fails to cache rocfft, so you'd have to compile pytorch from source still 😞.
If you want to avoid building from source completely, I'd recommend using the official pytorch releases: https://pytorch.org, or try to find a docker image setup for it (which would be a little bit more involved). Hopefully the fixes will get upstreamed soon though!
Perhaps there should be a note in the README about AMD compatibility?
I successfully reproduced @Gaolaboratory's results. I managed to run Vicuna 13B on my RX 6800 XT with the --load-8bit option, using some packages from my OS (Fedora 38).
@onyasumi
Can someone create instructions to install + run with ROCm please?
Install the ROCm package for your OS. Fedora 38 example below:
It seems that there is no flag for it to run in ROCm mode.
If PyTorch isn't installed, running pip install fschat will try to install it. If you specifically install the ROCm version of PyTorch beforehand, pip will notice that and skip installing PyTorch during the FastChat install. As a result, FastChat will just use ROCm through your install of PyTorch.
Reacted by fubuki, Lianmin Zheng, dsadulla1 and James Summerill
Activity
merrymercy commentedon Apr 4, 2023
Please refer to https://github.com/lm-sys/FastChat#vicuna-weights and https://github.com/lm-sys/FastChat#serving.
We only use PyTorch, so it should be easy to port to AMD if PyTorch supports AMD well.
Askejm commentedon Apr 4, 2023
you can attempt to use rocm on linux but it's far from a smooth experience
[-]AMD?[/-][+]AMD Support[/+]kira-bruneau commentedon Apr 15, 2023
I tried it out on my RX 7900 XTX and it loaded the whole Vicuna 13B model in 8bit mode into VRAM - but segfaulted after loading the checkpoint shards.
(I'm guessing since the card isn't officially supported by ROCm yet 😅: ROCm/legacy-rocm-build#1973)
I also setup the ROCm + Vicuna development environment using a Nix flake, but there are a few more tweaks I want to make before publishing it (eg. writing Nix packages for accelerate and gradio).
kira-bruneau commentedon Apr 19, 2023
🎉 I managed to this running on my RX 7900 XTX!! I just tracked down all the development commits that added gfx11 support to ROCm built it all from source.
I pushed my Nix flake here if anyone wants to try it out themself https://github.com/kira-bruneau/FastChat/commit/75235dac0365e11157dbd950bc1a4cf528f8ddc6.
(I have it hard-coded to target
gfx803&gfx1100, so you might want to change that if you have a different AMD card: https://github.com/kira-bruneau/FastChat/commit/75235dac0365e11157dbd950bc1a4cf528f8ddc6#diff-206b9ce276ab5971a2489d75eb1b12999d4bf3843b7988cbe8d687cfde61dea0R24)Steps:
Gaolaboratory commentedon Apr 23, 2023
I can confirm fastchat with vicuna 13b model runs fine with 8bit mode on a single AMD 6800 card. SYSTEM: Ubuntu 20 LTS, installed rocm 5.4.2, then pytorch with rocm 5.4.2 support. No need to build from source, works directly with all official packages.
kira-bruneau commentedon Apr 25, 2023
Oh yep sorry, for all other supported AMD cards you shouldn't need to build from source. I only had to because the RX 7900 XTX isn't supported in the release builds of ROCm yet.
aseok commentedon Jun 1, 2023
@kira-bruneau Is it still necessary for rx570(gfx803) to build from source?
kira-bruneau commentedon Jun 1, 2023
@aseok Oh nope! It was only necessary before the 5.5 ROCm release to support gfx1100.
Although... there are still some problems in nixpkgs that means there are parts that you still have to compile from source if you want to use the flake: (see NixOS/nixpkgs#230881) - right now the builder fails to cache rocfft, so you'd have to compile pytorch from source still 😞.
If you want to avoid building from source completely, I'd recommend using the official pytorch releases: https://pytorch.org, or try to find a docker image setup for it (which would be a little bit more involved). Hopefully the fixes will get upstreamed soon though!
fubuki4649 commentedon Jun 18, 2023
(@kira-bruneau) Can someone create instructions to install + run with ROCm please? It seems that there is no flag for it to run in ROCm mode.
JonLiuFYI commentedon Jun 29, 2023
Perhaps there should be a note in the README about AMD compatibility?
I successfully reproduced @Gaolaboratory's results. I managed to run Vicuna 13B on my RX 6800 XT with the
--load-8bitoption, using some packages from my OS (Fedora 38).@onyasumi
Install the ROCm package for your OS. Fedora 38 example below:
Follow PyTorch's instructions to get the ROCm version of PyTorch. Remember to verify that PyTorch detects your graphics card.
Install FastChat according to the README.
Download a model and try to use it in CLI.
If PyTorch isn't installed, running
pip install fschatwill try to install it. If you specifically install the ROCm version of PyTorch beforehand, pip will notice that and skip installing PyTorch during the FastChat install. As a result, FastChat will just use ROCm through your install of PyTorch.merrymercy commentedon Jul 5, 2023
@JonLiuFYI could you contribute a pull request to add some notes about AMD?
fubuki4649 commentedon Jul 5, 2023
@JonLiuFYI Thank you, this seemed to work for me. I can add a PR later to document this in the README
merrymercy commentedon Jul 6, 2023
@JonLiuFYI @onyasumi please go ahead. Thanks!