-
Notifications
You must be signed in to change notification settings - Fork 791
[UR][Benchmarks] GROMACS/Grappa benchmarks added to the suite #17934
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
d7490ca
d740745
acd567e
ac24577
1f4a931
0e95395
67eb2a4
3d93f9e
de067ca
ce86c6b
f530b0f
35c4630
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -0,0 +1,335 @@ | ||||
# Copyright (C) 2025 Intel Corporation | ||||
# Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions. | ||||
# See LICENSE.TXT | ||||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||||
|
||||
import os | ||||
import subprocess | ||||
import tarfile | ||||
import urllib.request | ||||
from pathlib import Path | ||||
from .base import Suite, Benchmark | ||||
from options import options | ||||
from utils.utils import git_clone | ||||
from utils.result import Result | ||||
|
||||
|
||||
class GromacsBench(Suite): | ||||
GROMACS_REPO = "https://gitlab.com/gromacs/gromacs.git" | ||||
PatKamin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||
GROMACS_TAG = "v2025.1" | ||||
PatKamin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||
GRAPPA_BENCHMARKS_URL = ( | ||||
"https://zenodo.org/record/11234002/files/grappa-1.5k-6.1M_rc0.9.tar.gz" | ||||
) | ||||
|
||||
def __init__(self, directory): | ||||
# Initialize GromacsBench-specific attributes | ||||
self.directory = Path(directory).resolve() | ||||
self.gromacs_dir = self.directory / "gromacs" | ||||
self.grappa_dir = self.directory / "grappa-1.5k-6.1M_rc0.9" | ||||
self.build_dir = self.gromacs_dir / "build" | ||||
|
||||
def name(self): | ||||
return "Gromacs Bench" | ||||
|
||||
def benchmarks(self) -> list[Benchmark]: | ||||
systems = [ | ||||
"0001.5", | ||||
"0003", | ||||
"0006", | ||||
"0012", | ||||
"0024", | ||||
"0048", | ||||
"0096", | ||||
"0192", | ||||
"0384", | ||||
] | ||||
return [ | ||||
GromacsSystemBenchmark(self, system, self.gromacs_dir, self.grappa_dir) | ||||
for system in systems | ||||
] | ||||
|
||||
def setup(self): | ||||
print(f"Working directory: {self.directory}") | ||||
|
||||
self.directory.mkdir(parents=True, exist_ok=True) | ||||
|
||||
if not self.gromacs_dir.exists(): | ||||
PatKamin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||
print( | ||||
f"Cloning GROMACS repository (tag: {self.GROMACS_TAG}) into {self.gromacs_dir}..." | ||||
) | ||||
repo_path = git_clone( | ||||
self.directory, | ||||
"gromacs-repo", | ||||
self.GROMACS_REPO, | ||||
self.GROMACS_TAG, | ||||
) | ||||
print(f"GROMACS repository cloned to {repo_path}") | ||||
else: | ||||
print(f"GROMACS repository already exists at {self.gromacs_dir}") | ||||
|
||||
# Build GROMACS | ||||
self.build_dir.mkdir(parents=True, exist_ok=True) | ||||
print(f"Building GROMACS in {self.build_dir}...") | ||||
subprocess.run( | ||||
|
||||
[ | ||||
"cmake", | ||||
"../", | ||||
f"-DCMAKE_BUILD_TYPE=Release", | ||||
f"-DCMAKE_CXX_COMPILER={options.sycl}/bin/clang++", | ||||
|
||||
f"-DCMAKE_C_COMPILER={options.sycl}/bin/clang", | ||||
f"-DGMX_GPU=SYCL", | ||||
f"-DGMX_SYCL_ENABLE_GRAPHS=ON", | ||||
This comment was marked as resolved.
Sorry, something went wrong. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||||
f"-DGMX_FFT_LIBRARY=MKL", | ||||
f"-DGMX_BUILD_OWN_FFTW=ON", | ||||
|
f"-DGMX_BUILD_OWN_FFTW=ON", |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use cmake -B {self.build_dir}
instead as a configure command parameter. Remove the positional parameter ../
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
PatKamin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use the existing utils.download
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove download_and_extract_grappa method and use utils.download instead for simplicity. If you find adding a verbose message is useful, please add it to utils.download
PatKamin marked this conversation as resolved.
Show resolved
Hide resolved
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this check to setup() as you try running this binary there first without a check.
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ONEAPI_DEVICE_SELECTOR
and SYCL_UR_USE_LEVEL_ZERO_V2
are set from benchmark cli.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm guessing this controls whether we use eager vs graph?
Can you make this configurable and add "eager"/"graph" variants of the benchmarks?
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this comment is no longer correct
pbalcer marked this conversation as resolved.
Show resolved
Hide resolved
pbalcer marked this conversation as resolved.
Show resolved
Hide resolved
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really get what this is for. Doesn't env=env_vars
work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well... yes, it works
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe create a function? these are nearly identical.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, a little simpler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove the imports you don't use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure