-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Installing all the submititnow subpackages. * Fixed rich file content viewing using StringIO. * Added support for all major slurm arguments. * Implemented custom action for --nodelist * Removed `slurm` prefix from the option strings * Changed `exp_name` to `exp-name` * Added gpu_matmul.py in examples for GPU testing * Bumping the version to 0.9.2 --------- Authored-by: Maharshi Gor <[email protected]>
- Loading branch information
1 parent
2e77fa2
commit e1cffe3
Showing
4 changed files
with
132 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import argparse | ||
from typing import Optional | ||
import torch | ||
from tqdm import trange | ||
|
||
def add_arguments( | ||
parser: Optional[argparse.ArgumentParser] = None, | ||
) -> argparse.ArgumentParser: | ||
if parser is None: | ||
parser = argparse.ArgumentParser('Perform a matrix multiplication on a GPU') | ||
|
||
parser.add_argument("--matrix-size", type=int, default=1000) | ||
parser.add_argument("--n-iter", type=int, default=10) | ||
|
||
return parser | ||
|
||
|
||
def main(args: argparse.Namespace): | ||
# Set torch seed to | ||
torch.manual_seed(42) | ||
|
||
for i in trange(args.n_iter): | ||
M1 = torch.randn(args.matrix_size, args.matrix_size).cuda() | ||
M2 = torch.randn(args.matrix_size, args.matrix_size).cuda() | ||
|
||
result = M1 @ M2 | ||
norm = torch.norm(result, p="fro") | ||
print(f"Norm of result: {norm}") | ||
|
||
|
||
if __name__ == "__main__": | ||
parser = add_arguments() | ||
args = parser.parse_args() | ||
main(args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
|
||
setuptools.setup( | ||
name="submititnow", | ||
version="0.9.1", | ||
version="0.9.2", | ||
author="Maharshi Gor", | ||
author_email="[email protected]", | ||
description="A package to make submitit easier to use", | ||
|
@@ -26,6 +26,7 @@ | |
"typer[all]>=0.7.0", | ||
"rich-cli>=1.8.0", | ||
"rich>=12.6.0", | ||
"tqdm>=4.0.0", | ||
], | ||
python_requires=">=3.8", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters