Skip to content

Commit

Permalink
fix a profiler bug
Browse files Browse the repository at this point in the history
  • Loading branch information
fsx950223 committed Oct 24, 2023
1 parent c9add3a commit f4c3c92
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 26 deletions.
27 changes: 9 additions & 18 deletions docker/Dockerfile.rocm
Original file line number Diff line number Diff line change
Expand Up @@ -19,33 +19,24 @@ FROM docker.io/rocm/pytorch:rocm5.6_ubuntu20.04_py3.8_pytorch_2.0.1
ENV UBSAN_OPTIONS=print_stacktrace=1
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
ADD ./docker/install/rocm_dev-requirements.txt dev-requirements.txt
RUN groupadd -f render

WORKDIR /

ADD ./docker/install/ /Install
RUN git clone -b merge_upstream https://github.com/ROCmSoftwarePlatform/AITemplate.git

WORKDIR /AITemplate
# necessary package
RUN bash /Install/install_basic_dep.sh
RUN bash ./docker/install/install_basic_dep.sh

# for test
RUN bash /Install/install_test_dep.sh
RUN bash ./docker/install/install_test_dep.sh

# for docs
RUN bash /Install/install_doc_dep.sh
RUN bash ./docker/install/install_doc_dep.sh

# for detection
RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata
RUN bash /Install/install_detection_deps.sh

# Copy AITemplate to Docker
RUN mkdir /AITemplate
ADD ./COMMIT_INFO /AITemplate/COMMIT_INFO
ADD ./python /AITemplate/python
ADD ./3rdparty /AITemplate/3rdparty
ADD ./examples /AITemplate/examples
ADD ./tests /AITemplate/tests
ADD ./docs /AITemplate/docs
ADD ./static /AITemplate/static
ADD ./licenses /AITemplate/licenses
RUN cd /AITemplate/python && python setup.py install
RUN bash ./docker/install/install_detection_deps.sh

RUN cd ./python && python setup.py install
14 changes: 7 additions & 7 deletions python/aitemplate/backend/profiler_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,6 @@ def process_task(task: Task) -> None:

if len(stderr) > 0:
# TODO: ugly fix, should remove when finish all profiler refactor
runtimes = PROF_RUNTIME_PATTERN.findall(stdout)
if len(runtimes) > 0:
single_file_profiler = True
if not single_file_profiler:
task._failed = True
return

_LOGGER.debug(
"Failed: [{name}][{algo}]\ncmd:\n{cmd}\nstderr:\n{stderr}".format(
name=task._name,
Expand All @@ -137,6 +130,13 @@ def process_task(task: Task) -> None:
stderr=stderr,
),
)
runtimes = PROF_RUNTIME_PATTERN.findall(stdout)
if len(runtimes) > 0:
single_file_profiler = True
if not single_file_profiler:
task._failed = True
return

task._ret, task._failed = extract_profile_result(
stdout=stdout,
return_ops=task._kwargs.get("return_ops", None),
Expand Down
2 changes: 1 addition & 1 deletion python/aitemplate/backend/rocm/conv2d/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@
const int64_t stride = std::stoi(argv[8]);
const int64_t pad = std::stoi(argv[9]);
const int64_t dilation = std::stoi(argv[10]);
const int64_t group = std::stoi(argv[11]);
const int64_t group = std::stoi(argv[14]);
"""
)

Expand Down

0 comments on commit f4c3c92

Please sign in to comment.