Skip to content

Commit c714a8a

Browse files
authored
Merge pull request #34 from cesar-avalos3/pytorch_integration
Pytorch examples integration
2 parents 3b95e19 + 58c0d8b commit c714a8a

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

.gitmodules

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
[submodule "src/cuda/cutlass-bench"]
55
path = src/cuda/cutlass-bench
66
url = https://github.com/NVIDIA/cutlass.git
7-
[submodule "src/cuda/pytorch_examples"]
8-
path = src/cuda/pytorch_examples
9-
url = https://github.com/pytorch/examples.git
107
[submodule "src/cuda/cuda-samples"]
118
path = src/cuda/cuda-samples
129
url = https://github.com/NVIDIA/cuda-samples.git
10+
[submodule "src/cuda/pytorch_examples"]
11+
path = src/cuda/pytorch_examples
12+
url = https://github.com/accel-sim/pytorch_examples.git
13+
branch = inference_accelsim_v2

src/Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,14 @@ cuda_samples:
498498
mkdir -p ./cuda/cuda-samples/build && cd ./cuda/cuda-samples/build && cmake .. && make
499499
find $(GPUAPPS_ROOT)/src/cuda/cuda-samples/build/Samples -type f -executable -exec mv {} "$(BINDIR)/$(BINSUBDIR)/" \; ;
500500

501+
pytorch_examples:
502+
mkdir -p $(BINDIR)/$(BINSUBDIR)/
503+
cp -r cuda/pytorch_examples $(BINDIR)/$(BINSUBDIR)
504+
echo "#!/bin/bash\npython $(BINDIR)/$(BINSUBDIR)/pytorch_examples/mnist/main.py --dry-run --epochs=1 --test-batch-size=64" > $(BINDIR)/$(BINSUBDIR)/inference_mnist
505+
chmod u+x $(BINDIR)/$(BINSUBDIR)/inference_mnist
506+
echo "#!/bin/bash\npython $(BINDIR)/$(BINSUBDIR)/pytorch_examples/vae/main.py --epochs=1" > $(BINDIR)/$(BINSUBDIR)/inference_vae
507+
chmod u+x $(BINDIR)/$(BINSUBDIR)/inference_vae
508+
501509
clean_heterosync:
502510
rm -rf cuda/heterosync
503511

@@ -664,5 +672,10 @@ clean_mlperf_inference:
664672
clean_mlperf_training:
665673
rm -rf $(BINDIR)/$(BINSUBDIR)/mlperf_training
666674

675+
clean_pytorch_examples:
676+
rm -rf $(BINDIR)/$(BINSUBDIR)/pytorch_examples
677+
rm -f $(BINDIR)/$(BINSUBDIR)/inference_mnist
678+
rm -f $(BINDIR)/$(BINSUBDIR)/inference_vae
679+
667680
clean_cuda_samples:
668681
make clean -C ./cuda/cuda-samples/build

0 commit comments

Comments
 (0)