-
Notifications
You must be signed in to change notification settings - Fork 456
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/dev'
- Loading branch information
Showing
25 changed files
with
200 additions
and
26 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
#!/usr/bin/env python3 | ||
import torch | ||
from causal_conv1d import causal_conv1d_fn | ||
import causal_conv1d_cuda | ||
|
||
batch, dim, seq, width = 10, 5, 17, 4 | ||
x = torch.zeros((batch, dim, seq)).to('cuda') | ||
weight = torch.zeros((dim, width)).to('cuda') | ||
bias = torch.zeros((dim, )).to('cuda') | ||
|
||
causal_conv1d_fn(x, weight, bias, None) | ||
conv1d_out = causal_conv1d_cuda.causal_conv1d_fwd(x, weight, bias, None, None, None, True) | ||
|
||
print('causal_conv1d OK\n') |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#--- | ||
# name: zigma | ||
# group: mamba | ||
# config: config.py | ||
# depends: [pytorch, torchvision, opencv:4.10.0, transformers, xformers, openai-triton, causalconv1d, mamba] | ||
# requires: '>=34.1.0' | ||
# test: test.py | ||
# notes: https://github.com/CompVis/zigma | ||
#--- | ||
ARG BASE_IMAGE | ||
FROM ${BASE_IMAGE} | ||
|
||
ARG ZIGMA_VERSION \ | ||
CUDAARCHS | ||
|
||
COPY build.sh /tmp/ZIGMA/ | ||
|
||
RUN /tmp/ZIGMA/build.sh | ||
|
||
CMD ["/bin/bash"] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env bash | ||
set -ex | ||
|
||
# Clone the repository if it doesn't exist | ||
git clone --branch=${ZIGMA_VERSION} --depth=1 --recursive https://github.com/CompVis/zigma opt/zigma || \ | ||
git clone --depth=1 --recursive https://github.com/CompVis/zigma /opt/zigma | ||
|
||
# Navigate to the directory containing mamba's setup.py | ||
cd /opt/zigma | ||
pip3 install -U torchdiffeq matplotlib h5py timm diffusers accelerate loguru blobfile ml_collections wandb | ||
pip3 install -U hydra-core torch-fidelity webdataset einops pytorch_lightning | ||
pip3 install -U torchmetrics scikit-learn moviepy imageio numpy-hilbert-curve av | ||
|
||
cd /opt/zigma | ||
pip3 install 'numpy<2' |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from jetson_containers import CUDA_ARCHITECTURES | ||
|
||
def zigma(version, requires=None, default=False): | ||
pkg = package.copy() | ||
|
||
if requires: | ||
pkg['requires'] = requires | ||
|
||
pkg['name'] = f'zigma:{version}' | ||
|
||
pkg['build_args'] = { | ||
'CUDAARCHS': ';'.join([str(x) for x in CUDA_ARCHITECTURES]), | ||
'ZIGMA_VERSION': version, | ||
} | ||
|
||
builder = pkg.copy() | ||
|
||
builder['name'] = f'zigma:{version}-builder' | ||
builder['build_args'] = {**pkg['build_args'], **{'FORCE_BUILD': 'on'}} | ||
|
||
if default: | ||
pkg['alias'] = 'zigma' | ||
builder['alias'] = 'zigma:builder' | ||
|
||
return pkg, builder | ||
|
||
package = [ | ||
zigma('1.0', default=True) | ||
] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env python3 | ||
|
||
from huggingface_hub import hf_hub_download | ||
from model_zigma import ZigMa | ||
import torch | ||
hf_hub_download( | ||
repo_id="taohu/zigma", | ||
filename="faceshq1024_0090000.pt", | ||
local_dir="./checkpoints", | ||
) | ||
|
||
|
||
img_dim = 32 | ||
in_channels = 3 | ||
|
||
model = ZigMa( | ||
in_channels=in_channels, | ||
embed_dim=640, | ||
depth=18, | ||
img_dim=img_dim, | ||
patch_size=1, | ||
has_text=True, | ||
d_context=768, | ||
n_context_token=77, | ||
device="cuda", | ||
scan_type="zigzagN8", | ||
use_pe=2, | ||
) | ||
|
||
x = torch.rand(10, in_channels, img_dim, img_dim).to("cuda") | ||
t = torch.rand(10).to("cuda") | ||
_context = torch.rand(10, 77, 768).to("cuda") | ||
o = model(x, t, y=_context) | ||
print(o.shape) | ||
|
||
print('zigma OK\n') |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#--- | ||
# name: shape-llm | ||
# alias: shape_llm | ||
# group: vlm | ||
# depends: [transformers, bitsandbytes, flash-attention, opencv:4.10.0] | ||
# requires: '>=35' | ||
# test: [test.sh, test.py] | ||
#--- | ||
ARG BASE_IMAGE | ||
FROM ${BASE_IMAGE} | ||
|
||
ADD https://github.com/gitapi/repos/qizekun/ShapeLLM/git/refs/heads/main /tmp/shape_llm_version.json | ||
|
||
RUN git clone --branch=main --depth=1 --recursive https://github.com/qizekun/ShapeLLM /opt/ShapeLLM && \ | ||
cd /opt/ShapeLLM && \ | ||
sed -i 's|torch==.*"|torch"|' pyproject.toml && \ | ||
sed -i 's|torchvision==.*"|torchvision"|' pyproject.toml && \ | ||
sed -i 's|bitsandbytes==.*"|bitsandbytes"|' pyproject.toml && \ | ||
sed -i 's|opencv-python==.*"|opencv-python"|' pyproject.toml && \ | ||
pip3 install --no-cache-dir --verbose -e '.[all]' | ||
|
||
#RUN pip3 install --no-cache-dir --verbose "git+https://github.com/erikwijmans/Pointnet2_PyTorch.git#egg=pointnet2_ops&subdirectory=pointnet2_ops_lib" | ||
RUN git clone https://github.com/erikwijmans/Pointnet2_PyTorch /opt/pointnet2 && \ | ||
cd /opt/pointnet2 && \ | ||
pip3 install --verbose -e pointnet2_ops_lib |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env python3 | ||
from llava import LlavaLlamaForCausalLM | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env bash | ||
set -ex | ||
|
||
python3 -m llava.serve.cli --help |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#--- | ||
# name: xtuner | ||
# group: vlm | ||
# depends: [transformers, bitsandbytes, flash-attention] | ||
# requires: '>=35' | ||
# test: [test.sh, test.py] | ||
#--- | ||
ARG BASE_IMAGE | ||
FROM ${BASE_IMAGE} | ||
|
||
ADD https://github.com/gitapi/repos/InternLM/xtuner/git/refs/heads/main /tmp/xtuner_version.json | ||
|
||
RUN git clone --branch=main --depth=1 --recursive https://github.com/InternLM/xtuner /opt/xtuner && \ | ||
cd /opt/xtuner && \ | ||
sed -i 's|bitsandbytes.*|bitsandbytes|' requirements/runtime.txt && \ | ||
sed -i 's|mpi4py-mpich.*||' requirements/deepspeed.txt && \ | ||
pip3 install --no-cache-dir --verbose -e '.[all]' | ||
|
||
# mmengine - WARNING - WARNING: command error: '[Errno 2] No such file or directory: 'python'' | ||
RUN ln -s /usr/bin/python3 /usr/bin/python && \ | ||
ln -s /usr/local/bin/python3 /usr/local/bin/python |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env python3 | ||
import xtuner | ||
print('xtuner version:', xtuner.__version__) | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env bash | ||
set -ex | ||
xtuner --help | ||
xtuner list-cfg |