Skip to content

Commit 82fd2fc

Browse files
cole-browerbrycelelbach
authored andcommitted
fix: rebase conflicts: brev: floating-point-emulation
1 parent 129c89f commit 82fd2fc

File tree

9 files changed

+82
-25
lines changed

9 files changed

+82
-25
lines changed

tutorials/floating-point-emulation/brev/docker-compose.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ x-config:
55
image: &image ghcr.io/nvidia/floating-point-emulation-tutorial:latest
66
working-dir: &working-dir /accelerated-computing-hub/tutorials/floating-point-emulation/notebooks
77
large: &large true
8+
default-jupyter-url: &default-jupyter-url
89
gpu-config: &gpu-config
910
privileged: true
1011
ulimits:
@@ -27,6 +28,9 @@ x-config:
2728
BREV_ENV_ID: ${BREV_ENV_ID:-}
2829
ACH_TUTORIAL: *tutorial-name
2930
ACH_RUN_TESTS: ${ACH_RUN_TESTS:-}
31+
ACH_USER: ${ACH_USER:-ach}
32+
ACH_UID: ${ACH_UID:-1000}
33+
ACH_GID: ${ACH_GID:-1000}
3034
user: root
3135
working_dir: *working-dir
3236
persistent-service: &persistent-service
@@ -39,23 +43,25 @@ services:
3943
base:
4044
<<: [*gpu-config, *common-service]
4145
image: *image
42-
entrypoint: ["/accelerated-computing-hub/brev/base-start.bash"]
46+
entrypoint: ["/accelerated-computing-hub/brev/entrypoint.bash", "base"]
4347
build:
4448
context: ../../..
4549
dockerfile: *dockerfile
4650
restart: "no"
4751
jupyter:
4852
<<: [*gpu-config, *common-service, *persistent-service]
4953
image: *image
54+
entrypoint: ["/accelerated-computing-hub/brev/entrypoint.bash", "jupyter"]
55+
command: *default-jupyter-url
5056
ports:
51-
- "0.0.0.0:8888:8888" # JupyterLab
57+
- "127.0.0.1:8888:8888" # JupyterLab
5258
nsight:
5359
<<: [*gpu-config, *common-service, *persistent-service]
5460
image: nvcr.io/nvidia/devtools/nsight-streamer-nsys:2025.3.1
55-
entrypoint: ["/accelerated-computing-hub/brev/nsight-start.bash"]
61+
entrypoint: ["/accelerated-computing-hub/brev/entrypoint.bash", "nsight"]
5662
ports:
57-
- "0.0.0.0:8080:8080" # HTTP
58-
- "0.0.0.0:3478:3478" # TURN
63+
- "127.0.0.1:8080:8080" # HTTP
64+
- "127.0.0.1:3478:3478" # TURN
5965

6066
volumes:
6167
accelerated-computing-hub:

tutorials/floating-point-emulation/brev/dockerfile

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
1-
FROM ubuntu:24.04 AS artifacts
2-
3-
COPY . /accelerated-computing-hub
4-
# RUN find /accelerated-computing-hub/tutorials \
5-
# -mindepth 1 -maxdepth 1 -type d -not -name "floating-point-emulation" \
6-
# -exec rm -rf {} +
7-
# RUN rm -rf /accelerated-computing-hub/.git
8-
91
FROM nvidia/cuda:13.1.0-base-ubuntu24.04
102

3+
ENV PIP_ROOT_USER_ACTION=ignore \
4+
ACH_TUTORIAL=floating-point-emulation \
5+
BASH_ENV=/accelerated-computing-hub/brev/user-setup.bash
6+
117
# Install CUDA Toolkit + build tools
128
RUN apt update -y \
13-
&& apt install -y wget curl gnupg lsb-release \
9+
&& apt install -y --no-install-recommends wget curl gnupg gosu lsb-release sudo \
1410
&& wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null \
1511
&& echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ noble main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null \
1612
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg \
@@ -44,8 +40,7 @@ RUN wget https://developer.nvidia.com/downloads/compute/cublasdx/redist/cublasdx
4440

4541
# Install python
4642
RUN python -m venv /opt/venv
47-
ENV ACH_TUTORIAL=floating-point-emulation \
48-
CUDA_PATH=/usr/local/cuda-13.1 \
43+
ENV CUDA_PATH=/usr/local/cuda-13.1 \
4944
PATH="/opt/venv/bin:$PATH" \
5045
LD_LIBRARY_PATH="/opt/nvidia/libmathdx/lib:$LD_LIBRARY_PATH"
5146

@@ -64,12 +59,26 @@ RUN set -ex \
6459
&& ln -fs /accelerated-computing-hub/brev/ipython-startup-add-cwd-to-path.py ~/.ipython/profile_default/startup/00-add-cwd-to-path.py \
6560
&& python -m jupyter labextension disable "@jupyterlab/apputils-extension:announcements"
6661

67-
COPY --from=artifacts /accelerated-computing-hub /accelerated-computing-hub
62+
# Enable passwordless sudo for all users and pass through environment and path
63+
RUN echo 'ALL ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers \
64+
&& sed -i -e 's/^Defaults\s*env_reset/#&/' -e 's/^Defaults\s*secure_path=/#&/' /etc/sudoers
65+
66+
COPY . /accelerated-computing-hub
67+
68+
# Ensure accelerated-computing-hub directory is writable by any user and setup shell initialization
69+
RUN chmod -R a+rwX /accelerated-computing-hub \
70+
&& mkdir -p /accelerated-computing-hub/logs \
71+
&& chmod 777 /accelerated-computing-hub/logs \
72+
&& ln -s /accelerated-computing-hub/brev/user-setup.bash /etc/profile.d/ach-user-setup.sh \
73+
&& echo 'source /accelerated-computing-hub/brev/user-setup.bash' >> /etc/bash.bashrc
6874

6975
WORKDIR /accelerated-computing-hub/tutorials/${ACH_TUTORIAL}/notebooks
7076

7177
# Setup Git.
7278
RUN git config --unset-all "http.https://github.com/.extraheader" || { code=$?; [ "$code" = 5 ] || exit "$code"; } \
7379
&& git config --global --add safe.directory "/accelerated-computing-hub"
7480

75-
ENTRYPOINT ["/accelerated-computing-hub/brev/jupyter-start.bash"]
81+
# Set default user to ach (can be overriden with docker run --user)
82+
USER ach
83+
84+
ENTRYPOINT ["/accelerated-computing-hub/brev/entrypoint.bash", "jupyter"]

tutorials/floating-point-emulation/notebooks/01-Introduction/01-Introduction.ipynb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@
9999
}
100100
],
101101
"metadata": {
102+
"accelerator": "GPU",
103+
"colab": {
104+
"gpuType": "T4",
105+
"provenance": [],
106+
"toc_visible": true
107+
},
102108
"kernelspec": {
103109
"display_name": "Python 3 (ipykernel)",
104110
"language": "python",
@@ -114,7 +120,7 @@
114120
"name": "python",
115121
"nbconvert_exporter": "python",
116122
"pygments_lexer": "ipython3",
117-
"version": "3.12.12"
123+
"version": "3.11.7"
118124
}
119125
},
120126
"nbformat": 4,

tutorials/floating-point-emulation/notebooks/02-Matmul-Fundamentals/02.01-MatmulFundamentals.ipynb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1527,6 +1527,12 @@
15271527
}
15281528
],
15291529
"metadata": {
1530+
"accelerator": "GPU",
1531+
"colab": {
1532+
"gpuType": "T4",
1533+
"provenance": [],
1534+
"toc_visible": true
1535+
},
15301536
"kernelspec": {
15311537
"display_name": "Python 3 (ipykernel)",
15321538
"language": "python",
@@ -1542,7 +1548,7 @@
15421548
"name": "python",
15431549
"nbconvert_exporter": "python",
15441550
"pygments_lexer": "ipython3",
1545-
"version": "3.12.3"
1551+
"version": "3.11.7"
15461552
}
15471553
},
15481554
"nbformat": 4,

tutorials/floating-point-emulation/notebooks/02-Matmul-Fundamentals/02.02-MatmulWithcuBLASDx.ipynb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -925,6 +925,12 @@
925925
}
926926
],
927927
"metadata": {
928+
"accelerator": "GPU",
929+
"colab": {
930+
"gpuType": "T4",
931+
"provenance": [],
932+
"toc_visible": true
933+
},
928934
"kernelspec": {
929935
"display_name": "Python 3 (ipykernel)",
930936
"language": "python",
@@ -940,7 +946,7 @@
940946
"name": "python",
941947
"nbconvert_exporter": "python",
942948
"pygments_lexer": "ipython3",
943-
"version": "3.10.12"
949+
"version": "3.11.7"
944950
}
945951
},
946952
"nbformat": 4,

tutorials/floating-point-emulation/notebooks/03-Ozaki-I-Emulation/03.01-UnfusedEmulation.ipynb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -960,6 +960,12 @@
960960
}
961961
],
962962
"metadata": {
963+
"accelerator": "GPU",
964+
"colab": {
965+
"gpuType": "T4",
966+
"provenance": [],
967+
"toc_visible": true
968+
},
963969
"kernelspec": {
964970
"display_name": "Python 3 (ipykernel)",
965971
"language": "python",
@@ -975,7 +981,7 @@
975981
"name": "python",
976982
"nbconvert_exporter": "python",
977983
"pygments_lexer": "ipython3",
978-
"version": "3.12.3"
984+
"version": "3.11.7"
979985
}
980986
},
981987
"nbformat": 4,

tutorials/floating-point-emulation/notebooks/03-Ozaki-I-Emulation/03.02-PartiallyFusedEmulation.ipynb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -930,6 +930,12 @@
930930
}
931931
],
932932
"metadata": {
933+
"accelerator": "GPU",
934+
"colab": {
935+
"gpuType": "T4",
936+
"provenance": [],
937+
"toc_visible": true
938+
},
933939
"kernelspec": {
934940
"display_name": "Python 3 (ipykernel)",
935941
"language": "python",
@@ -945,7 +951,7 @@
945951
"name": "python",
946952
"nbconvert_exporter": "python",
947953
"pygments_lexer": "ipython3",
948-
"version": "3.12.3"
954+
"version": "3.11.7"
949955
}
950956
},
951957
"nbformat": 4,

tutorials/floating-point-emulation/notebooks/03-Ozaki-I-Emulation/03.03-FusedEmulation.ipynb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -937,6 +937,12 @@
937937
}
938938
],
939939
"metadata": {
940+
"accelerator": "GPU",
941+
"colab": {
942+
"gpuType": "T4",
943+
"provenance": [],
944+
"toc_visible": true
945+
},
940946
"kernelspec": {
941947
"display_name": "Python 3 (ipykernel)",
942948
"language": "python",
@@ -952,7 +958,7 @@
952958
"name": "python",
953959
"nbconvert_exporter": "python",
954960
"pygments_lexer": "ipython3",
955-
"version": "3.12.3"
961+
"version": "3.11.7"
956962
}
957963
},
958964
"nbformat": 4,

tutorials/floating-point-emulation/notebooks/04-Challenge-Exercises/04.01-SYRK.ipynb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -832,6 +832,12 @@
832832
}
833833
],
834834
"metadata": {
835+
"accelerator": "GPU",
836+
"colab": {
837+
"gpuType": "T4",
838+
"provenance": [],
839+
"toc_visible": true
840+
},
835841
"kernelspec": {
836842
"display_name": "Python 3 (ipykernel)",
837843
"language": "python",
@@ -847,7 +853,7 @@
847853
"name": "python",
848854
"nbconvert_exporter": "python",
849855
"pygments_lexer": "ipython3",
850-
"version": "3.12.12"
856+
"version": "3.11.7"
851857
}
852858
},
853859
"nbformat": 4,

0 commit comments

Comments
 (0)