Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Oct 9, 2024
1 parent d4da8b8 commit a2b6694
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion benchmarks/lightning/main.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
#!/usr/bin/env python

from habana_frameworks.torch import hpu; hpu.init()

import argparse
import os

os.environ["PT_HPU_LAZY_MODE"] = str(int(os.getenv("WORLD_SIZE", -1) <= 0))

from habana_frameworks.torch import hpu; hpu.init()

import torch
import torch.nn.functional as F
import lightning as L
Expand Down
2 changes: 1 addition & 1 deletion docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ hpu:
# docker system prune -a -f
# docker image prune -a -f
docker build --build-arg BENCH=$(bench) --build-arg CACHEBUST=`git rev-parse hpu` -f Dockerfile-hpu -t dockerfile-hpu .
docker run -rm -it --runtime=habana -e PT_HPU_LAZY_MODE=$(lazy) -e HABANA_VISIBLE_DEVICES=all -e OMPI_MCA_btl_vader_single_copy_mechanism=none --shm-size 50G --cap-add=sys_nice --net=host dockerfile-hpu:latest bash -c '. $$MILABENCH_VENV/bin/activate && milabench install --use-current-env --select $(bench) && pip uninstall torch torchvision torchaudio -y && milabench prepare --use-current-env --select $(bench) && milabench run --use-current-env $(args) --select $(bench)'
docker run --rm -it --runtime=habana -e PT_HPU_LAZY_MODE=$(lazy) -e HABANA_VISIBLE_DEVICES=all -e OMPI_MCA_btl_vader_single_copy_mechanism=none --shm-size 50G --cap-add=sys_nice --net=host dockerfile-hpu:latest bash -c '. $$MILABENCH_VENV/bin/activate && milabench install --use-current-env --select $(bench) && pip uninstall torch torchvision torchaudio -y && milabench prepare --use-current-env --select $(bench) && milabench run --use-current-env $(args) --select $(bench)'

0 comments on commit a2b6694

Please sign in to comment.