Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update dep + fix #265

Merged
merged 5 commits into from
Jan 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM nvidia/cuda:11.6.1-devel-ubuntu20.04
FROM nvidia/cuda:12.0.0-devel-ubuntu22.04
ENV DEBIAN_FRONTEND=noninteractive

ENV CUDA_INSTALL_PATH=/usr/local/cuda/
Expand All @@ -21,16 +21,16 @@ RUN apt-get install -y git \
python3.9-dev \
nano

RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.8 1 && \
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1 && \
update-alternatives --install /usr/bin/python python /usr/bin/python3.9 2 && \
update-alternatives --set python /usr/bin/python3.9 && \
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1 && \
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1 && \
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 2 && \
update-alternatives --set python3 /usr/bin/python3.9

RUN python3.9 -m ensurepip --default-pip --upgrade

RUN pip install --pre torch==2.0.0.dev20230119+cu117 --extra-index-url https://download.pytorch.org/whl/nightly/cu117
RUN pip install --pre torch==2.0.0.dev20230128+cu117 --extra-index-url https://download.pytorch.org/whl/nightly/cu117


WORKDIR /syncback
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ If you prefer `Docker`:

```shell
# build
make docker_build
DOCKER_BUILDKIT=1 docker build -t kernl .
# run
docker run --rm -it --gpus all -v $(pwd):/kernl kernl
Expand Down
2 changes: 1 addition & 1 deletion experimental/whisper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ To run the notebook through shell, use the following command:
DOCKER_BUILDKIT=1 docker build -t kernl .
docker run --rm -it --gpus all -v $(pwd):/kernl kernl
apt install libsndfile1-dev # used by a Python audio dependency
pip install datasets soundfile librosa -q
pip install datasets soundfile librosa jupyter notebook
jupyter nbconvert --execute --clear-output experimental/whisper/speedup.ipynb --log-level=10
```
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
triton==2.0.0.dev20221202
torch==2.0.0.dev20230119+cu117
torch==2.0.0.dev20230128+cu117
pytest
tabulate
termcolor
Expand Down
2 changes: 1 addition & 1 deletion src/kernl/optimizer/cuda_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def cuda_graphs_wrapper(model: Callable, inputs: Union[list[torch.Tensor], tuple
f = cudagraphify_impl(
model=lambda args: model(*args), inputs=inputs, static_input_idxs=tuple(range(len(inputs)))
)
return lambda args: f(get_static_inputs(args))
return lambda *args: f(get_static_inputs(args))

compiled_fn = None

Expand Down
4 changes: 2 additions & 2 deletions test/test_attention.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def test_benchmark_skinny_cross_attention(benchmark, implementation, shape):
output = torch.empty_like(q)
fn = implementations_skinny_cross_attention[implementation](output, sm_scale)
r = cuda_graphs_wrapper(fn, [q, k, v])
_ = r([q, k, v])[0]
result = benchmark(r, [q, k, v])[0]
_ = r(q, k, v)[0]
result = benchmark(r, q, k, v)[0]

assert_all_close(a=expected, b=result.float(), atol=1e-2)
4 changes: 2 additions & 2 deletions test/test_layer_norm.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def test_benchmark_layer_norm(benchmark, shape: int, dtype, cuda_graphs: bool, i
if cuda_graphs:
run = cuda_graphs_wrapper(model=fn, inputs=[x])
# CUDA graphs wraps output in a tuple
fn = lambda tensor: run([tensor])[0] # noqa: E731
fn = lambda tensor: run(tensor)[0] # noqa: E731

value = benchmark(fn, x)
assert_all_close(value.float(), expected, atol=1e-1)
Expand Down Expand Up @@ -101,7 +101,7 @@ def test_benchmark_rms_norm(benchmark, shape: int, dtype, cuda_graphs: bool, imp
if cuda_graphs:
run = cuda_graphs_wrapper(model=fn, inputs=[x])
# CUDA graphs wraps output in a tuple
fn = lambda tensor: run([tensor])[0] # noqa: E731
fn = lambda tensor: run(tensor)[0] # noqa: E731

value = benchmark(fn, x)
assert_all_close(value.float(), expected, atol=1e-1)
Expand Down
2 changes: 1 addition & 1 deletion test/test_linear_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def test_benchmark(
if cuda_graphs:
run = cuda_graphs_wrapper(model=fn, inputs=[x])
# CUDA graphs wraps output in a tuple
fn = lambda tensor: run([tensor])[0] # noqa: E731
fn = lambda tensor: run(tensor)[0] # noqa: E731

value = benchmark(fn, x)

Expand Down