Update Matrix-based Benchmark

This commit is contained in:
Alauddin Maulana Hirzan 2024-06-16 21:02:48 +07:00
parent 207196a10a
commit 575c687363
Signed by: maulanahirzan
GPG key ID: 484DAC952787FA13
2 changed files with 8 additions and 3 deletions

View file

@ -32,18 +32,22 @@ class MatrixBench():
def run(self): def run(self):
print("# Linpack-like Matrix-based Floating Point Benchmark #") print("# Linpack-like Matrix-based Floating Point Benchmark #")
print("# Using NumPy as Core #") print("# Using NumPy as Core #")
print(f"# Matrix Size : {self.size} #")
print(f"# Iterations : {self.iters} #")
for i in range(1, self.iters+1): for i in range(1, self.iters+1):
print(f"=> Epoch #{str(i).zfill(len(str(self.iters)))}", end="\r") print(f"=> Epoch #{str(i).zfill(len(str(self.iters)))}", end="\r")
self.create_matrices() self.create_matrices()
self.do_operation() self.do_operation()
self.do_calculate() self.do_calculate()
print("\n")
self.avg_flops: float = (self.average/self.iters) / 1000000 self.avg_flops: float = (self.average/self.iters) / 1000000
print(f"Result : {self.avg_flops:.2f} MFLOPS") print(f"Result : {self.avg_flops:.2f} MFLOPS")
def main(): def main():
# Adjust Matrix Size # Adjust Matrix Size
size = 192 size = 512
# Adjust Iteration Time # Adjust Iteration Time
iters = 10000 iters = 10000
# Run Benchmark # Run Benchmark

View file

@ -2,7 +2,8 @@
### Inspired by Linpack HPL benchmark ### ### Inspired by Linpack HPL benchmark ###
## Contains two options: ## ## Contains two options: ##
* NumPy script (which requires numpy lib) <= Preferable * NumPy script (which requires numpy lib) <= **Run This**
* SciPy script (which requires scipy lib) * Increase **the matrix size** as you wish
* SciPy script (which requires scipy lib) <= No Further Update, **Do not run**
### Warning: SciPy based scipt kinda buggy and produces many warnings (the warnings are already suppresed for visual) ### ### Warning: SciPy based scipt kinda buggy and produces many warnings (the warnings are already suppresed for visual) ###