-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added benchmark function and results to doc
- Loading branch information
Showing
11 changed files
with
343 additions
and
89 deletions.
There are no files selected for viewing
230 changes: 230 additions & 0 deletions
230
.benchmarks/Linux-CPython-3.8-64bit/4db3fce6f8c51aa6bd15d627b6ec6693725b806d.json
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,230 @@ | ||
{ | ||
"machine_info": { | ||
"node": "bhd0038", | ||
"processor": "x86_64", | ||
"machine": "x86_64", | ||
"python_compiler": "GCC 7.3.0", | ||
"python_implementation": "CPython", | ||
"python_implementation_version": "3.8.8", | ||
"python_version": "3.8.8", | ||
"python_build": [ | ||
"default", | ||
"Feb 24 2021 21:46:12" | ||
], | ||
"release": "3.10.0-1160.31.1.el7.x86_64", | ||
"system": "Linux", | ||
"cpu": { | ||
"python_version": "3.8.8.final.0 (64 bit)", | ||
"cpuinfo_version": [ | ||
8, | ||
0, | ||
0 | ||
], | ||
"cpuinfo_version_string": "8.0.0", | ||
"arch": "X86_64", | ||
"bits": 64, | ||
"count": 36, | ||
"arch_string_raw": "x86_64", | ||
"vendor_id_raw": "GenuineIntel", | ||
"brand_raw": "Intel(R) Xeon(R) Gold 6140 CPU @ 2.30GHz", | ||
"hz_advertised_friendly": "2.3000 GHz", | ||
"hz_actual_friendly": "1.7326 GHz", | ||
"hz_advertised": [ | ||
2300000000, | ||
0 | ||
], | ||
"hz_actual": [ | ||
1732580000, | ||
0 | ||
], | ||
"stepping": 4, | ||
"model": 85, | ||
"family": 6, | ||
"flags": [ | ||
"3dnowprefetch", | ||
"abm", | ||
"acpi", | ||
"adx", | ||
"aes", | ||
"aperfmperf", | ||
"apic", | ||
"arat", | ||
"arch_perfmon", | ||
"art", | ||
"avx", | ||
"avx2", | ||
"avx512bw", | ||
"avx512cd", | ||
"avx512dq", | ||
"avx512f", | ||
"avx512vl", | ||
"bmi1", | ||
"bmi2", | ||
"bts", | ||
"cat_l3", | ||
"cdp_l3", | ||
"clflush", | ||
"clflushopt", | ||
"clwb", | ||
"cmov", | ||
"constant_tsc", | ||
"cqm", | ||
"cqm_llc", | ||
"cqm_mbm_local", | ||
"cqm_mbm_total", | ||
"cqm_occup_llc", | ||
"cx16", | ||
"cx8", | ||
"dca", | ||
"de", | ||
"ds_cpl", | ||
"dtes64", | ||
"dtherm", | ||
"dts", | ||
"eagerfpu", | ||
"epb", | ||
"ept", | ||
"erms", | ||
"est", | ||
"f16c", | ||
"flexpriority", | ||
"flush_l1d", | ||
"fma", | ||
"fpu", | ||
"fsgsbase", | ||
"fxsr", | ||
"hle", | ||
"ht", | ||
"ibpb", | ||
"ibrs", | ||
"ida", | ||
"intel_ppin", | ||
"intel_pt", | ||
"intel_stibp", | ||
"invpcid", | ||
"invpcid_single", | ||
"lahf_lm", | ||
"lm", | ||
"mba", | ||
"mca", | ||
"mce", | ||
"md_clear", | ||
"mmx", | ||
"monitor", | ||
"movbe", | ||
"mpx", | ||
"msr", | ||
"mtrr", | ||
"nonstop_tsc", | ||
"nopl", | ||
"nx", | ||
"ospke", | ||
"pae", | ||
"pat", | ||
"pbe", | ||
"pcid", | ||
"pclmulqdq", | ||
"pdcm", | ||
"pdpe1gb", | ||
"pebs", | ||
"pge", | ||
"pku", | ||
"pln", | ||
"pni", | ||
"popcnt", | ||
"pse", | ||
"pse36", | ||
"pts", | ||
"rdrand", | ||
"rdseed", | ||
"rdt_a", | ||
"rdtscp", | ||
"rep_good", | ||
"rtm", | ||
"sdbg", | ||
"sep", | ||
"smap", | ||
"smep", | ||
"smx", | ||
"spec_ctrl", | ||
"ss", | ||
"ssbd", | ||
"sse", | ||
"sse2", | ||
"sse4_1", | ||
"sse4_2", | ||
"ssse3", | ||
"stibp", | ||
"syscall", | ||
"tm", | ||
"tm2", | ||
"tpr_shadow", | ||
"tsc", | ||
"tsc_adjust", | ||
"tsc_deadline_timer", | ||
"vme", | ||
"vmx", | ||
"vnmi", | ||
"vpid", | ||
"x2apic", | ||
"xgetbv1", | ||
"xsave", | ||
"xsavec", | ||
"xsaveopt", | ||
"xtopology", | ||
"xtpr" | ||
], | ||
"l3_cache_size": 25952256, | ||
"l2_cache_size": 1048576, | ||
"l1_data_cache_size": 32768, | ||
"l1_instruction_cache_size": 32768 | ||
} | ||
}, | ||
"commit_info": { | ||
"id": "4db3fce6f8c51aa6bd15d627b6ec6693725b806d", | ||
"time": "2021-07-09T15:19:26-04:00", | ||
"author_time": "2021-07-09T15:19:26-04:00", | ||
"dirty": true, | ||
"project": "hoomd-tf", | ||
"branch": "issue-279" | ||
}, | ||
"benchmarks": [ | ||
{ | ||
"group": null, | ||
"name": "test_lj_benchmark", | ||
"fullname": "htf/test-py/benchmark.py::test_lj_benchmark", | ||
"params": null, | ||
"param": null, | ||
"extra_info": {}, | ||
"options": { | ||
"disable_gc": false, | ||
"timer": "perf_counter", | ||
"min_rounds": 5, | ||
"max_time": 1.0, | ||
"min_time": 5e-06, | ||
"warmup": false | ||
}, | ||
"stats": { | ||
"min": 1.9830403740052134, | ||
"max": 3.0145940768998116, | ||
"mean": 2.2169361331500115, | ||
"stddev": 0.448255204004423, | ||
"rounds": 5, | ||
"median": 2.0034955348819494, | ||
"iqr": 0.33898555068299174, | ||
"q1": 1.986543036007788, | ||
"q3": 2.3255285866907798, | ||
"iqr_outliers": 1, | ||
"stddev_outliers": 1, | ||
"outliers": "1;1", | ||
"ld15iqr": 1.9830403740052134, | ||
"hd15iqr": 3.0145940768998116, | ||
"ops": 0.45107298539047896, | ||
"total": 11.084680665750057, | ||
"iterations": 1 | ||
} | ||
} | ||
], | ||
"datetime": "2021-07-10T02:21:23.047649", | ||
"version": "3.4.1" | ||
} |
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
This file was deleted.
Oops, something went wrong.
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,48 @@ | ||
def test_lj_benchmark(benchmark): | ||
|
||
import hoomd.htf as htf | ||
from hoomd.htf import tfcompute | ||
import hoomd | ||
import hoomd.md | ||
import hoomd.dump | ||
import hoomd.group | ||
import numpy as np | ||
import tensorflow as tf | ||
|
||
class LJModel(htf.SimModel): | ||
def compute(self, nlist, positions, box): | ||
# get r | ||
rinv = htf.nlist_rinv(nlist) | ||
inv_r6 = rinv**6 | ||
# pairwise energy. Double count -> divide by 2 | ||
p_energy = 4.0 / 2.0 * (inv_r6 * inv_r6 - inv_r6) | ||
# sum over pairwise energy | ||
energy = tf.reduce_sum(input_tensor=p_energy, axis=1) | ||
forces = htf.compute_nlist_forces(nlist, energy) | ||
|
||
return forces | ||
|
||
N = 256 | ||
NN = 64 | ||
model = LJModel(NN) | ||
tfcompute = htf.tfcompute(model) | ||
hoomd.context.initialize('') | ||
rcut = 3.0 | ||
sqrt_N = int(np.sqrt(N)) | ||
|
||
system = hoomd.init.create_lattice(unitcell=hoomd.lattice.sq(a=2.0), | ||
n=[sqrt_N, sqrt_N]) | ||
nlist = hoomd.md.nlist.cell(check_period=1) | ||
# basic LJ forces from Hoomd | ||
lj = hoomd.md.pair.lj(rcut, nlist) | ||
lj.pair_coeff.set('A', 'A', epsilon=1.0, sigma=1.0) | ||
hoomd.md.integrate.mode_standard(dt=0.005) | ||
hoomd.md.integrate.langevin(group=hoomd.group.all(), kT=1.0, seed=42) | ||
# equilibrate for 4k steps first | ||
hoomd.run(4000) | ||
# now attach the LJ force model | ||
tfcompute.attach(nlist, | ||
r_cut=rcut) | ||
|
||
# train on 1k timesteps | ||
benchmark.pedantic(hoomd.run, (1000,), rounds=5, iterations=1) |
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,6 @@ | ||
# pytest-benchmark.ini | ||
[pytest] | ||
minversion = 6.0 | ||
addopts = -v --durations=0 --benchmark-autosave | ||
python_files = htf/test-py/benchmark.py | ||
required_plugins = pytest-cov pytest-xdist pytest-benchmark |
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,4 @@ | ||
# pytest.ini | ||
[pytest] | ||
minversion = 6.0 | ||
addopts = -v --durations=0 --forked |
Oops, something went wrong.