Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
38ebeeb
[docs] multi-tenancy load generator
YunSunny00 Oct 28, 2025
ed18bb6
Improve README with multi-tenancy examples and details
YWHyuk Oct 28, 2025
44b234e
Merge pull request #172 from PSAL-POSTECH/readme
YWHyuk Oct 29, 2025
0a6f248
[Frontend] Change ExecutionEngine to PyTorchSimExecutionEngine
wok1909 Oct 15, 2025
216f4de
[Refactor] Rename execution engine as a PyTorchSimRunner
YWHyuk Oct 29, 2025
6a0fcee
Merge pull request #168 from PSAL-POSTECH/tmp
YWHyuk Oct 29, 2025
84b8b21
[Refactor] Rearchitect MLIRMultiDim class
YWHyuk Oct 31, 2025
5f9f098
Merge pull request #174 from PSAL-POSTECH/Tile
YWHyuk Nov 4, 2025
f10038e
[Frontend] Template autotune
YunSunny00 Oct 3, 2025
fe22e9b
[Cleanup] Remove codegen_headers
YWHyuk Nov 5, 2025
f400d68
[Cleanup] Refactor conv template + autotune primitive
YWHyuk Nov 5, 2025
8c96a5a
[Autotune] Connect autotune template
YWHyuk Nov 5, 2025
3692365
[Fix] Fix wrong divder in reduction fusion
YWHyuk Nov 6, 2025
4ed48b2
Merge pull request #167 from PSAL-POSTECH/autotune
YWHyuk Nov 6, 2025
3660e2d
[CI] Add accuracy validation
YWHyuk Nov 10, 2025
3b04ccf
Merge pull request #178 from PSAL-POSTECH/accuracy
YWHyuk Nov 12, 2025
1ed9ca6
[Fix] fix typo in backendsim + simlator.py (#176, #177)
YWHyuk Nov 12, 2025
1ccc0db
Merge pull request #180 from PSAL-POSTECH/typo
YWHyuk Nov 12, 2025
9936bb0
[doc] add CMEM in readme
YunSunny00 Nov 12, 2025
2eb2ea3
[doc] autotune template readme
YunSunny00 Nov 12, 2025
fd2bdc1
[environment] build from source
YunSunny00 Nov 12, 2025
1a5ad29
Merge pull request #179 from PSAL-POSTECH/readme
YWHyuk Nov 12, 2025
ce9950f
[Performance] fix renamed variable access
YWHyuk Nov 12, 2025
a6e6ea9
[CI] Store validation results as an artifact
YWHyuk Nov 13, 2025
ca6a758
[Fix] Keep loop_size variable in the choice list
YWHyuk Nov 13, 2025
0fcc618
[Fix] Use correct vec_size #183
YWHyuk Nov 20, 2025
85a46a6
[CI] Use self-hosted runner for later stage of building
YWHyuk Nov 21, 2025
0d306c5
[Build] Remove deprecated submodule
YWHyuk Nov 21, 2025
3238d72
[Cleanup] Remove deprecated llvm folders
YWHyuk Nov 21, 2025
18b769a
[CI] debug
YWHyuk Nov 21, 2025
dbc0bec
[fix] gem5 build pass
YunSunny00 Nov 29, 2025
1e3f445
[refactor] config renaming
YunSunny00 Nov 29, 2025
87a87a4
[refactor] environment variable
YunSunny00 Nov 29, 2025
a44bbdd
[Refactor] code & logs
YunSunny00 Nov 29, 2025
764f123
[refactor] device name
YunSunny00 Nov 29, 2025
7ded98c
[Refactor] Add missing core_freq -> core_freq_mhz
YWHyuk Nov 30, 2025
d4f54aa
Refactor] Add missing dram_freq -> dram_freq_mhz
YWHyuk Nov 30, 2025
b9eaeff
[Refactor] Rename *_log_print_interval_cycle -> *_stats_print_period_…
YWHyuk Nov 30, 2025
ba600e8
[Refactor] Cleanup unused config options
YWHyuk Nov 30, 2025
5bba4ae
[Refactor] Define trace log format: [cycle][core][event]
YWHyuk Nov 30, 2025
b96852a
Merge branch 'perf' into refactor
YWHyuk Nov 30, 2025
8ce1c5b
Merge pull request #185 from PSAL-POSTECH/refactor
YWHyuk Nov 30, 2025
18daf42
Merge branch 'develop' into perf
YWHyuk Nov 30, 2025
902f13a
[Fix] Change validation mode to functional mode
YWHyuk Nov 30, 2025
2a0c0d7
[Fix] typo in interconnect logging message
YWHyuk Nov 30, 2025
d62b12e
Fix typo in core_stats_print_period_cycles
YWHyuk Nov 30, 2025
8bcceaf
Fix path syntax for accuracy report artifact
YWHyuk Nov 30, 2025
623b7be
Change PyTorchSimBackend to TOGSim
wok1909 Nov 30, 2025
6675f59
Merge pull request #186 from PSAL-POSTECH/rename
YWHyuk Nov 30, 2025
e3cc1fb
[refactor] compiler opt config
YunSunny00 Nov 30, 2025
10364c8
[refactor] simulator log
YunSunny00 Nov 30, 2025
b220a90
[Tutorial] HelloPyTorchSim
YunSunny00 Nov 30, 2025
853e93a
Merge pull request #187 from PSAL-POSTECH/tutorial
YWHyuk Nov 30, 2025
184a83b
[CI] remove deprecated file
YWHyuk Nov 21, 2025
00f46ff
[Tutorial] Interface for Hands-on session
YWHyuk Nov 30, 2025
0d0e071
Dockerfile for tutorial
wok1909 Nov 30, 2025
0d5745c
Fix method of getting param from os env
wok1909 Nov 30, 2025
69b9b4b
[Tutorial] fix env var
YunSunny00 Nov 30, 2025
3f5b50d
[fix] log typo
YunSunny00 Nov 30, 2025
ef297f9
[fix] tutorial order fix
YunSunny00 Nov 30, 2025
0941856
Add import math
wok1909 Nov 30, 2025
31fec87
Add session2 hands-on
wok1909 Nov 30, 2025
a3ddabd
[TOGSim] Add VOQ for simple interconnect
YWHyuk Nov 30, 2025
a553288
[TOGSim] Fix incorrect icnt frequency
YWHyuk Nov 30, 2025
66b0103
[TOGSim] Fix DMA stat logging and unify stat formatting
YWHyuk Dec 1, 2025
92aeeef
Merge pull request #181 from PSAL-POSTECH/perf
YWHyuk Dec 1, 2025
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
3 changes: 2 additions & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
build-and-test:
runs-on: ubuntu-latest
runs-on: self-hosted

permissions:
contents: read
Expand Down Expand Up @@ -35,6 +35,7 @@ jobs:
context: .
file: ./Dockerfile
push: true
no-cache: true
tags: ghcr.io/psal-postech/torchsim-test:${{ github.sha }}

# Step 4: Wait for GHCR propagation
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/pytorchsim_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -662,3 +662,37 @@ jobs:
-e TORCHSIM_VECTOR_LANE="${{ inputs.vector_lane }}" \
-e TORCHSIM_SPAD_SIZE="${{ inputs.spad_size }}" \
${{ inputs.image_name }} python3 PyTorchSim/tests/test_scheduler.py

test_accuracy:
name: Run test_accuracy
runs-on: self-hosted
steps:
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Prepare volume directory
run: mkdir -p /tmp/torchsim-ci/${GITHUB_SHA}

- name: Run run_cycle.sh
run: |
echo "Running run_cycle.sh"
docker run --rm \
-v /tmp/torchsim-ci/${GITHUB_SHA}:/dump \
-e TORCHSIM_DUMP_PATH=/dump \
-e TORCHSIM_VECTOR_LANE="${{ inputs.vector_lane }}" \
-e TORCHSIM_SPAD_SIZE="${{ inputs.spad_size }}" \
${{ inputs.image_name }} bash -c \
"cd /workspace && PyTorchSim/experiments/artifact/cycle_validation/run_cycle.sh && \
cp PyTorchSim/experiments/artifact/cycle_validation/summary_cycle.out /dump/summary_cycle.out"
ls /tmp/torchsim-ci/${GITHUB_SHA}

- name: Upload Accuracy Report Artifact
uses: actions/upload-artifact@v4
with:
name: accuracy-report
path: /tmp/torchsim-ci/${{ github.sha }}/summary_cycle.out
if-no-files-found: error
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__pycache__/
PyTorchSimBackend/build/
TOGSim/build/
.vscode
23 changes: 10 additions & 13 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
[submodule "PyTorchSimBackend/extern/onnx"]
path = PyTorchSimBackend/extern/onnx
[submodule "TOGSim/extern/onnx"]
path = TOGSim/extern/onnx
url = https://github.com/onnx/onnx.git
[submodule "PyTorchSimBackend/extern/protobuf"]
path = PyTorchSimBackend/extern/protobuf
[submodule "TOGSim/extern/protobuf"]
path = TOGSim/extern/protobuf
url = https://github.com/protocolbuffers/protobuf.git
[submodule "PyTorchSimBackend/extern/booksim"]
path = PyTorchSimBackend/extern/booksim
[submodule "TOGSim/extern/booksim"]
path = TOGSim/extern/booksim
url = https://github.com/PSAL-POSTECH/booksim.git
[submodule "PyTorchSimBackend/extern/torch2timeloop"]
path = PyTorchSimBackend/extern/torch2timeloop
url = https://github.com/Accelergy-Project/pytorch2timeloop-converter.git
[submodule "PyTorchSimBackend/extern/ramulator2"]
path = PyTorchSimBackend/extern/ramulator2
[submodule "TOGSim/extern/ramulator2"]
path = TOGSim/extern/ramulator2
url = https://github.com/PSAL-POSTECH/ramulator2
[submodule "PyTorchSimBackend/extern/stonneCore"]
path = PyTorchSimBackend/extern/stonneCore
[submodule "TOGSim/extern/stonneCore"]
path = TOGSim/extern/stonneCore
url = https://github.com/PSAL-POSTECH/stonne_core.git
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM ghcr.io/psal-postech/torchsim_base:latest
# Prepare PyTorchSim project
COPY . /workspace/PyTorchSim

RUN cd PyTorchSim/PyTorchSimBackend && \
RUN cd PyTorchSim/TOGSim && \
mkdir -p build && \
cd build && \
conan install .. --build=missing && \
Expand Down
90 changes: 90 additions & 0 deletions Dockerfile.ksc2025
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Copyright (c) 2020 The Regents of the University of California
# All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer;
# redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution;
# neither the name of the copyright holders nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
FROM pytorch/pytorch:2.2.0-cuda12.1-cudnn8-runtime

# Copied from Gem5 Docker file
ENV DEBIAN_FRONTEND=noninteractive
RUN apt -y update && apt -y upgrade && \
apt -y install build-essential git m4 scons zlib1g zlib1g-dev \
libprotobuf-dev protobuf-compiler libprotoc-dev libgoogle-perftools-dev \
python3-dev python-is-python3 doxygen libboost-all-dev \
libhdf5-serial-dev python3-pydot libpng-dev libelf-dev pkg-config pip \
python3-venv black libssl-dev libasan5 libubsan1
RUN pip install mypy pre-commit jupyter

# Pass Access Token securely
ENV PATH=$PATH:/root/.local/bin
ENV LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:/opt/conda/lib:/usr/local/nvidia/lib:/usr/local/nvidia/lib64:$LD_LIBRARY_PATH

# Build Gem5
RUN git clone https://github.com/PSAL-POSTECH/gem5.git --branch TorchSim
RUN cd gem5 && scons build/RISCV/gem5.opt -j $(nproc)
ENV GEM5_PATH=/workspace/gem5/build/RISCV/gem5.opt

# Build LLVM RISC-V
RUN git clone https://github.com/PSAL-POSTECH/llvm-project.git --branch torchsim --depth 1
RUN cd llvm-project && mkdir build && cd build && \
cmake -DLLVM_ENABLE_PROJECTS=mlir -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/riscv-llvm -DLLVM_TARGETS_TO_BUILD=RISCV -G "Unix Makefiles" ../llvm && \
make -j && make install

# Store RISC-V LLVM for TorchSim
ENV TORCHSIM_LLVM_PATH=/riscv-llvm/bin
ENV TORCHSIM_LLVM_INCLUDE_PATH=/riscv-llvm/include
ENV TORCHSIM_DIR=/workspace/PyTorchSim
ENV LLVM_DIR=/riscv-llvm

# Download RISC-V tool chain
RUN apt install -y wget && \
wget https://github.com/riscv-collab/riscv-gnu-toolchain/releases/download/2023.12.14/riscv64-glibc-ubuntu-22.04-llvm-nightly-2023.12.14-nightly.tar.gz && \
wget https://github.com/riscv-collab/riscv-gnu-toolchain/releases/download/2023.12.14/riscv64-elf-ubuntu-20.04-llvm-nightly-2023.12.14-nightly.tar.gz && \
tar -zxvf riscv64-elf-ubuntu-20.04-llvm-nightly-2023.12.14-nightly.tar.gz && tar -zxvf riscv64-elf-ubuntu-20.04-llvm-nightly-2023.12.14-nightly.tar.gz && \
rm *.tar.gz

ENV RISCV=/workspace/riscv
ENV PATH=$RISCV/bin:$PATH

# Install Spike simulator
RUN apt -y install device-tree-compiler
RUN git clone https://github.com/PSAL-POSTECH/riscv-isa-sim.git --branch TorchSim && cd riscv-isa-sim && mkdir build && cd build && \
../configure --prefix=$RISCV && make -j && make install

# Install Proxy kernel
RUN git clone https://github.com/riscv-software-src/riscv-pk.git && \
cd riscv-pk && git checkout 4f3debe4d04f56d31089c1c716a27e2d5245e9a1 && mkdir build && cd build && \
../configure --prefix=$RISCV --host=riscv64-unknown-elf && make -j && make install

# Install torchsim dependency
RUN apt install ninja-build && pip install onnx matplotlib && pip install --user conan==1.56.0

# Prepare ONNXim project
RUN git clone https://github.com/PSAL-POSTECH/PyTorchSim.git --branch tutorial
RUN cd PyTorchSim/TOGSim && \
git submodule update --recursive --init && \
mkdir -p build && \
cd build && \
conan install .. --build=missing && \
cmake .. && \
make -j$(nproc)
34 changes: 0 additions & 34 deletions PyTorchSimBackend/configs/heterogeneous_c2_simple_noc.json

This file was deleted.

32 changes: 0 additions & 32 deletions PyTorchSimBackend/configs/stonne_big_c1_simple_noc.json

This file was deleted.

31 changes: 0 additions & 31 deletions PyTorchSimBackend/configs/stonne_single_c1_simple_noc.json

This file was deleted.

31 changes: 0 additions & 31 deletions PyTorchSimBackend/configs/stonne_validation_c1_simple_noc.json

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading