counted-float 0.9.6__tar.gz → 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. {counted_float-0.9.6 → counted_float-1.0.0}/PKG-INFO +128 -92
  2. {counted_float-0.9.6 → counted_float-1.0.0}/README.md +127 -91
  3. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/_core/_cli.py +7 -1
  4. counted_float-1.0.0/counted_float/_core/benchmarking/__init__.py +37 -0
  5. counted_float-1.0.0/counted_float/_core/benchmarking/counted_float/__init__.py +1 -0
  6. counted_float-1.0.0/counted_float/_core/benchmarking/counted_float/_counted_float_benchmark.py +83 -0
  7. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/_core/benchmarking/micro/_micro_benchmark.py +2 -2
  8. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/_core/counting/_builtin_data.py +12 -7
  9. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/_core/counting/config/_defaults.py +13 -8
  10. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/_core/models/_flop_weights.py +20 -8
  11. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/_core/utils/__init__.py +1 -0
  12. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/_core/utils/_missing_data.py +1 -5
  13. counted_float-1.0.0/counted_float/_core/utils/_rounding.py +66 -0
  14. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/benchmarking/__init__.py +2 -1
  15. {counted_float-0.9.6 → counted_float-1.0.0}/pyproject.toml +1 -1
  16. counted_float-0.9.6/counted_float/_core/benchmarking/__init__.py +0 -11
  17. {counted_float-0.9.6 → counted_float-1.0.0}/.gitignore +0 -0
  18. {counted_float-0.9.6 → counted_float-1.0.0}/LICENSE +0 -0
  19. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/__init__.py +0 -0
  20. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/_core/__init__.py +0 -0
  21. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/_core/benchmarking/flops/__init__.py +0 -0
  22. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/_core/benchmarking/flops/_array_generator.py +0 -0
  23. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/_core/benchmarking/flops/_flops_benchmark_suite.py +0 -0
  24. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/_core/benchmarking/flops/_flops_micro_benchmark.py +0 -0
  25. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/_core/benchmarking/micro/__init__.py +0 -0
  26. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/_core/compatibility/__init__.py +0 -0
  27. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/_core/compatibility/_numba.py +0 -0
  28. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/_core/counting/__init__.py +0 -0
  29. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/_core/counting/_context_managers.py +0 -0
  30. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/_core/counting/_counted_float.py +0 -0
  31. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/_core/counting/_global_counter.py +0 -0
  32. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/_core/counting/config/__init__.py +0 -0
  33. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/_core/counting/config/_config.py +0 -0
  34. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/_core/models/__init__.py +0 -0
  35. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/_core/models/_base.py +0 -0
  36. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/_core/models/_flop_counts.py +0 -0
  37. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/_core/models/_flop_type.py +0 -0
  38. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/_core/models/_flops_benchmark_meta_data.py +0 -0
  39. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/_core/models/_flops_benchmark_result.py +0 -0
  40. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/_core/models/_flops_benchmark_type.py +0 -0
  41. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/_core/models/_instruction_latencies.py +0 -0
  42. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/_core/models/_micro_benchmark_result.py +0 -0
  43. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/_core/utils/_cpu_freq.py +0 -0
  44. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/_core/utils/_formatting.py +0 -0
  45. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/_core/utils/_geo_mean.py +0 -0
  46. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/_core/utils/_latency.py +0 -0
  47. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/_core/utils/_timer.py +0 -0
  48. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/config/__init__.py +0 -0
  49. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/arm/v8_x/benchmarks/apple_m3_max_mbp16.json +0 -0
  50. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/arm/v8_x/benchmarks/apple_m3_mba15.json +0 -0
  51. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/arm/v8_x/benchmarks/ec2_m6g_xlarge_graviton_2_neoverse_n1.json +0 -0
  52. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/arm/v8_x/benchmarks/ec2_m7g_xlarge_graviton_3_neoverse_v1.json +0 -0
  53. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/arm/v8_x/benchmarks/gh_apple_m1.json +0 -0
  54. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/arm/v8_x/specs/arm_v8_cortex_a76.json +0 -0
  55. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/arm/v8_x/specs/arm_v9_cortex_x1.json +0 -0
  56. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/arm/v8_x/specs/arm_v9_neoverse_n1.json +0 -0
  57. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/arm/v8_x/specs/arm_v9_neoverse_v1.json +0 -0
  58. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/arm/v9_0/benchmarks/ec2_m8g_xlarge_graviton_4_neoverse_v2.json +0 -0
  59. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/arm/v9_0/benchmarks/gh_azure_cobalt_100_neoverse_n2.json +0 -0
  60. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/arm/v9_0/specs/arm_v9_cortex_x2.json +0 -0
  61. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/arm/v9_0/specs/arm_v9_cortex_x3.json +0 -0
  62. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/arm/v9_0/specs/arm_v9_neoverse_n2.json +0 -0
  63. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/arm/v9_0/specs/arm_v9_neoverse_v2.json +0 -0
  64. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/arm/v9_2/benchmarks/apple_m4_pro_mbp16.json +0 -0
  65. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/arm/v9_2/specs/arm_v9_cortex_x4.json +0 -0
  66. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/arm/v9_2/specs/arm_v9_cortex_x925.json +0 -0
  67. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/arm/v9_2/specs/arm_v9_neoverse_v3.json +0 -0
  68. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/x86/amd/2017_zen1/analysis_uops_info_zen1+.json +0 -0
  69. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/x86/amd/2017_zen1/benchmark_ryzen_1700x.json +0 -0
  70. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/x86/amd/2020_zen3/analysis_agner_fog_r7_5800x.json +0 -0
  71. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/x86/amd/2020_zen3/analysis_uops_info_zen3.json +0 -0
  72. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/x86/amd/2020_zen3/benchmark_gh_amd_epyc_7763_linux.json +0 -0
  73. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/x86/amd/2020_zen3/benchmark_gh_amd_epyc_7763_windows.json +0 -0
  74. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/x86/amd/2022_zen4/analysis_agner_fog_r9_7900x.json +0 -0
  75. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/x86/amd/2022_zen4/analysis_uops_info_zen4.json +0 -0
  76. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/x86/amd/2022_zen4/benchmark_ec2_m7a_xlarge_zen4.json +0 -0
  77. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/x86/amd/2022_zen4/specs_amd.json +0 -0
  78. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/x86/amd/2024_zen5/analysis_agner_fog_r7_9800x3d.json +0 -0
  79. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/x86/amd/2024_zen5/benchmark_ec2_m8a_xlarge_zen5.json +0 -0
  80. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/x86/amd/2024_zen5/specs_amd.json +0 -0
  81. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/x86/intel/2017_coffee_lake_gen_8/analysis_agner_fog_coffee_lake.json +0 -0
  82. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/x86/intel/2017_coffee_lake_gen_8/analysis_uops_info_coffee_lake.json +0 -0
  83. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/x86/intel/2017_coffee_lake_gen_8/benchmark_gh_intel_i7_8700B_macos.json +0 -0
  84. /counted_float-0.9.6/counted_float/data/x86/intel/2017_coffee_lake_gen_8/benchmark_gh_intel_i7_8550U_windows.json → /counted_float-1.0.0/counted_float/data/x86/intel/2017_coffee_lake_gen_8/benchmark_intel_i7_8550U_windows.json +0 -0
  85. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/x86/intel/2019_sunny_cove_gen_10/analysis_agner_fog_ice_lake.json +0 -0
  86. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/x86/intel/2019_sunny_cove_gen_10/analysis_uops_info_ice_lake.json +0 -0
  87. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/x86/intel/2019_sunny_cove_gen_10/analysis_uops_info_tiger_lake.json +0 -0
  88. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/x86/intel/2019_sunny_cove_gen_10/benchmark_ec2_m6i_xlarge_ice_lake.json +0 -0
  89. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/x86/intel/2021_golden_cove_gen_12/analysis_uops_info_alder_lake_p.json +0 -0
  90. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/x86/intel/2021_golden_cove_gen_12/benchmark_ec2_m7i_xlarge_sapphire_rapids.json +0 -0
  91. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/x86/intel/2021_golden_cove_gen_12/specs_intel.json +0 -0
  92. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/x86/intel/2022_raptor_cove_gen_13_14/benchmark_ec2_i7i_xlarge_emerald_rapids.json +0 -0
  93. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/x86/intel/2022_raptor_cove_gen_13_14/specs_intel.json +0 -0
  94. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/x86/intel/2023_redwood_cove_ultra_1/benchmark_ec2_m8i_xlarge_granite_rapids.json +0 -0
  95. {counted_float-0.9.6 → counted_float-1.0.0}/counted_float/data/x86/intel/2023_redwood_cove_ultra_1/specs_intel.json +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: counted-float
3
- Version: 0.9.6
3
+ Version: 1.0.0
4
4
  Summary: Count floating-point operations in Python code & benchmark relative flop costs.
5
5
  Project-URL: Source, https://github.com/bertpl/counted-float
6
6
  Project-URL: ChangeLog, https://github.com/bertpl/counted-float/blob/develop/CHANGELOG.md
@@ -21,9 +21,9 @@ Description-Content-Type: text/markdown
21
21
 
22
22
  <!--START_SECTION:images-->
23
23
  ![shields.io-python-versions](https://img.shields.io/badge/python-3.11%20%7C%203.12%20%7C%203.13-blue)
24
- ![genbadge-test-count](https://bertpl.github.io/counted-float/version_artifacts/v0.9.6/badge-test-count.svg)
25
- ![genbadge-test-coverage](https://bertpl.github.io/counted-float/version_artifacts/v0.9.6/badge-coverage.svg)
26
- ![counted_float logo](https://bertpl.github.io/counted-float/version_artifacts/v0.9.6/splash.webp)
24
+ ![genbadge-test-count](https://bertpl.github.io/counted-float/version_artifacts/v1.0.0/badge-test-count.svg)
25
+ ![genbadge-test-coverage](https://bertpl.github.io/counted-float/version_artifacts/v1.0.0/badge-coverage.svg)
26
+ ![counted_float logo](https://bertpl.github.io/counted-float/version_artifacts/v1.0.0/splash.webp)
27
27
  <!--END_SECTION:images-->
28
28
 
29
29
  # counted-float
@@ -162,30 +162,33 @@ rationale behind choice of data sources and methodology.
162
162
  >>> get_active_flop_weights().show()
163
163
 
164
164
  {
165
- FlopType.ABS [abs(x)] : 1
166
- FlopType.MINUS [-x] : 1
167
- FlopType.COMP [x<=y] : 1
168
- FlopType.RND [round] : 2
169
- FlopType.F2I [float->int] : 2
170
- FlopType.I2F [int->float] : 2
171
- FlopType.ADD [x+y] : 1
172
- FlopType.SUB [x-y] : 1
173
- FlopType.MUL [x*y] : 1
174
- FlopType.DIV [x/y] : 5
175
- FlopType.SQRT [sqrt(x)] : 6
176
- FlopType.CBRT [cbrt(x)] : 42
177
- FlopType.EXP [e^x] : 19
178
- FlopType.EXP2 [2^x] : 29
179
- FlopType.EXP10 [10^x] : 23
180
- FlopType.LOG [log(x)] : 19
181
- FlopType.LOG2 [log2(x)] : 24
182
- FlopType.LOG10 [log10(x)] : 19
183
- FlopType.POW [x^y] : 62
184
- FlopType.SIN [sin(x)] : 32
185
- FlopType.COS [cos(x)] : 31
186
- FlopType.TAN [tan(x)] : 34
165
+ FlopType.MINUS [-x] : 0.45000
166
+ FlopType.ABS [abs(x)] : 0.70000
167
+ FlopType.ADD [x+y] : 1.00000
168
+ FlopType.COMP [x<=y] : 1.00000
169
+ FlopType.SUB [x-y] : 1.00000
170
+ FlopType.MUL [x*y] : 1.40000
171
+ FlopType.RND [round] : 1.80000
172
+ FlopType.F2I [float->int] : 2.00000
173
+ FlopType.I2F [int->float] : 2.00000
174
+ FlopType.DIV [x/y] : 5.50000
175
+ FlopType.SQRT [sqrt(x)] : 7.50000
176
+ FlopType.EXP2 [2^x] : 16.00000
177
+ FlopType.EXP [e^x] : 18.00000
178
+ FlopType.LOG [log(x)] : 20.00000
179
+ FlopType.LOG2 [log2(x)] : 22.00000
180
+ FlopType.EXP10 [10^x] : 24.00000
181
+ FlopType.LOG10 [log10(x)] : 24.00000
182
+ FlopType.COS [cos(x)] : 30.00000
183
+ FlopType.SIN [sin(x)] : 30.00000
184
+ FlopType.POW [x^y] : 40.00000
185
+ FlopType.TAN [tan(x)] : 40.00000
186
+ FlopType.CBRT [cbrt(x)] : 45.00000
187
187
  }
188
188
  ```
189
+ Note that these weights are rounded up to the ~10% closest semi-round number, reflecting a balance between accuracy and readability,
190
+ while conveying the message that these weights should be used as approximations only. See further down for the different rounding modes.
191
+
189
192
  These weights will be used by default when extracting total weighted flop costs:
190
193
 
191
194
  ```python
@@ -202,7 +205,7 @@ with FlopCountingContext() as ctx:
202
205
  _ = math.log2(cf2)
203
206
 
204
207
  flop_counts = ctx.flop_counts()
205
- total_cost = flop_counts.total_weighted_cost() # 1 + 62 + 24 = 87
208
+ total_cost = flop_counts.total_weighted_cost() # 1 + 40 + 22 = 63
206
209
  ```
207
210
  Note that the `total_weighted_cost` method will use the default flop weights as returned by `get_flop_weights()`. This can be
208
211
  overridden by either configuring different flop weights (see next section) or by setting the `weights` argument of the `total_weighted_cost()` method.
@@ -229,33 +232,38 @@ Built-in flop weights can be inspected using the following functions:
229
232
  ```python
230
233
  from counted_float.config import get_default_consensus_flop_weights
231
234
 
232
- >>> get_default_consensus_flop_weights(rounded=False).show()
235
+ >>> get_default_consensus_flop_weights(rounding_mode=None).show()
233
236
 
234
237
  {
235
- FlopType.ABS [abs(x)] : 0.63673
236
- FlopType.MINUS [-x] : 0.64396
237
- FlopType.COMP [x<=y] : 1.20756
238
- FlopType.RND [round] : 1.54041
239
- FlopType.F2I [float->int] : 1.99099
240
- FlopType.I2F [int->float] : 1.84601
238
+ FlopType.MINUS [-x] : 0.46773
239
+ FlopType.ABS [abs(x)] : 0.70012
240
+ FlopType.COMP [x<=y] : 0.96923
241
+ FlopType.SUB [x-y] : 0.99846
241
242
  FlopType.ADD [x+y] : 1.00000
242
- FlopType.SUB [x-y] : 1.00586
243
- FlopType.MUL [x*y] : 1.37238
244
- FlopType.DIV [x/y] : 5.07465
245
- FlopType.SQRT [sqrt(x)] : 5.90559
246
- FlopType.CBRT [cbrt(x)] : 42.39375
247
- FlopType.EXP [e^x] : 18.58228
248
- FlopType.EXP2 [2^x] : 28.88672
249
- FlopType.EXP10 [10^x] : 22.86839
250
- FlopType.LOG [log(x)] : 18.89135
251
- FlopType.LOG2 [log2(x)] : 24.34792
252
- FlopType.LOG10 [log10(x)] : 18.55085
253
- FlopType.POW [x^y] : 61.79155
254
- FlopType.SIN [sin(x)] : 31.91490
255
- FlopType.COS [cos(x)] : 30.79295
256
- FlopType.TAN [tan(x)] : 34.37970
243
+ FlopType.MUL [x*y] : 1.39950
244
+ FlopType.RND [round] : 1.77232
245
+ FlopType.F2I [float->int] : 1.91485
246
+ FlopType.I2F [int->float] : 1.92200
247
+ FlopType.DIV [x/y] : 5.53105
248
+ FlopType.SQRT [sqrt(x)] : 7.35657
249
+ FlopType.EXP2 [2^x] : 15.85687
250
+ FlopType.EXP [e^x] : 17.51909
251
+ FlopType.LOG [log(x)] : 19.00419
252
+ FlopType.LOG2 [log2(x)] : 22.38002
253
+ FlopType.EXP10 [10^x] : 23.02693
254
+ FlopType.LOG10 [log10(x)] : 24.65718
255
+ FlopType.SIN [sin(x)] : 30.40612
256
+ FlopType.COS [cos(x)] : 31.39434
257
+ FlopType.POW [x^y] : 41.81031
258
+ FlopType.TAN [tan(x)] : 42.15636
259
+ FlopType.CBRT [cbrt(x)] : 44.32376
257
260
  }
258
261
  ```
262
+ There are 3 rounding modes:
263
+ - `None` -> no rounding
264
+ - `"nearest_int"` -> round up/down to nearest integer, with a minimum of 1
265
+ - `"10%"` -> round to nearest semi-round number within ~10% (default)
266
+
259
267
 
260
268
  The default weights that are configured out-of-the-box in the package are the integer-rounded `consensus` weights.
261
269
 
@@ -270,28 +278,28 @@ from counted_float.config import get_builtin_flop_weights
270
278
  >>> get_builtin_flop_weights(key_filter="arm").show()
271
279
 
272
280
  {
273
- FlopType.ABS [abs(x)] : 0.97313
274
- FlopType.MINUS [-x] : 0.99098
275
- FlopType.COMP [x<=y] : 1.03987
276
- FlopType.RND [round] : 1.35111
277
- FlopType.F2I [float->int] : 1.52648
278
- FlopType.I2F [int->float] : 1.63320
281
+ FlopType.COMP [x<=y] : 0.65000
282
+ FlopType.MINUS [-x] : 0.90000
279
283
  FlopType.ADD [x+y] : 1.00000
280
- FlopType.SUB [x-y] : 1.00058
281
- FlopType.MUL [x*y] : 1.44952
282
- FlopType.DIV [x/y] : 5.00897
283
- FlopType.SQRT [sqrt(x)] : 5.15597
284
- FlopType.CBRT [cbrt(x)] : 39.30448
285
- FlopType.EXP [e^x] : 17.22817
286
- FlopType.EXP2 [2^x] : 15.82232
287
- FlopType.EXP10 [10^x] : 21.20195
288
- FlopType.LOG [log(x)] : 17.51472
289
- FlopType.LOG2 [log2(x)] : 18.32529
290
- FlopType.LOG10 [log10(x)] : 17.19903
291
- FlopType.POW [x^y] : 47.63289
292
- FlopType.SIN [sin(x)] : 29.58923
293
- FlopType.COS [cos(x)] : 28.54904
294
- FlopType.TAN [tan(x)] : 31.87442
284
+ FlopType.SUB [x-y] : 1.00000
285
+ FlopType.ABS [abs(x)] : 1.10000
286
+ FlopType.F2I [float->int] : 1.50000
287
+ FlopType.MUL [x*y] : 1.50000
288
+ FlopType.I2F [int->float] : 1.60000
289
+ FlopType.RND [round] : 1.60000
290
+ FlopType.DIV [x/y] : 6.00000
291
+ FlopType.SQRT [sqrt(x)] : 7.50000
292
+ FlopType.EXP2 [2^x] : 16.00000
293
+ FlopType.EXP [e^x] : 18.00000
294
+ FlopType.LOG [log(x)] : 20.00000
295
+ FlopType.LOG2 [log2(x)] : 20.00000
296
+ FlopType.EXP10 [10^x] : 24.00000
297
+ FlopType.LOG10 [log10(x)] : 24.00000
298
+ FlopType.COS [cos(x)] : 33.00000
299
+ FlopType.SIN [sin(x)] : 33.00000
300
+ FlopType.POW [x^y] : 40.00000
301
+ FlopType.CBRT [cbrt(x)] : 45.00000
302
+ FlopType.TAN [tan(x)] : 45.00000
295
303
  }
296
304
  ```
297
305
 
@@ -335,29 +343,29 @@ div : wwwwwwwwwwwwwww.........................
335
343
  div_div : wwwwwwwwwwwwwww......................... [ 5.00 µs ± 0.2% | 20.3K cpu cycles ± 0.2% ] / 1000 iterations
336
344
  lte_addsub : wwwwwwwwwwwwwww......................... [ 1.71 µs ± 0.2% | 6.94K cpu cycles ± 0.2% ] / 1000 iterations
337
345
 
338
- >>> results.flop_weights.show()
346
+ >>> results.flop_weights().show()
339
347
 
340
348
  {
341
- FlopType.ABS [abs(x)] : 0.90556
342
- FlopType.MINUS [-x] : 0.90089
343
- FlopType.COMP [x<=y] : 1.67297
344
- FlopType.RND [round] : 1.24118
349
+ FlopType.ABS [abs(x)] : 0.89904
350
+ FlopType.MINUS [-x] : 0.90935
351
+ FlopType.SUB [x-y] : 0.99676
345
352
  FlopType.ADD [x+y] : 1.00000
346
- FlopType.SUB [x-y] : 0.99928
347
- FlopType.MUL [x*y] : 1.52656
348
- FlopType.DIV [x/y] : 4.06589
349
- FlopType.SQRT [sqrt(x)] : 5.26487
350
- FlopType.CBRT [cbrt(x)] : 39.49190
351
- FlopType.EXP [e^x] : 17.34508
352
- FlopType.EXP2 [2^x] : 16.70475
353
- FlopType.EXP10 [10^x] : 21.03351
354
- FlopType.LOG [log(x)] : 17.59412
355
- FlopType.LOG2 [log2(x)] : 18.08932
356
- FlopType.LOG10 [log10(x)] : 17.27955
357
- FlopType.POW [x^y] : 38.32044
358
- FlopType.SIN [sin(x)] : 28.67006
359
- FlopType.COS [cos(x)] : 29.11818
360
- FlopType.TAN [tan(x)] : 32.28703
353
+ FlopType.RND [round] : 1.24397
354
+ FlopType.MUL [x*y] : 1.55516
355
+ FlopType.COMP [x<=y] : 1.69018
356
+ FlopType.DIV [x/y] : 4.12333
357
+ FlopType.SQRT [sqrt(x)] : 5.42419
358
+ FlopType.EXP2 [2^x] : 16.95266
359
+ FlopType.LOG10 [log10(x)] : 17.60079
360
+ FlopType.EXP [e^x] : 17.76250
361
+ FlopType.LOG [log(x)] : 17.86149
362
+ FlopType.LOG2 [log2(x)] : 18.42380
363
+ FlopType.EXP10 [10^x] : 21.50729
364
+ FlopType.SIN [sin(x)] : 29.31571
365
+ FlopType.COS [cos(x)] : 29.56218
366
+ FlopType.TAN [tan(x)] : 32.88570
367
+ FlopType.POW [x^y] : 39.35018
368
+ FlopType.CBRT [cbrt(x)] : 40.16857
361
369
  FlopType.F2I [float->int] : nan
362
370
  FlopType.I2F [int->float] : nan
363
371
  }
@@ -459,10 +467,38 @@ ALL 0.47 0.70
459
467
 
460
468
  ```
461
469
 
462
- # 5. Known limitations
470
+ ## 4.2. Test performance of `CountedFloat` vs `float`
471
+
472
+ ```
473
+ [~] counted_float benchmark-counted-float
474
+ ```
475
+ See next section for results.
476
+
477
+ # 5. Performance impact
478
+
479
+ Obviously, using `CountedFloat` instead of regular `float` will have a performance impact due to the overhead of counting operations.
480
+ It is not advised to use `CountedFloat` for production code, but just for research code for which you want to estimate the floating-point operation count.
481
+
482
+ Micro-benchmarking of a bisection algorithm using `counted_float benchmark-counted-float` teaches us this:
483
+ ```
484
+ ------------------------------------------------------------------------------------------------------------------------
485
+ Running CountedFloat benchmark...
486
+
487
+ float : wwwwwwwwwwwwwww................................... [ 12.34 µs ± 1.2% | 50.1K cpu cycles ± 1.2% ] / execution
488
+ CountedFloat : wwwwwwwwwwwwwww................................... [ 459.95 µs ± 0.2% | 1.87M cpu cycles ± 0.2% ] / execution
489
+ ------------------------------------------------------------------------------------------------------------------------
490
+
491
+ CountedFloat Benchmark Results:
492
+ Bisection using float : 12.34 µs / execution
493
+ Bisection using CountedFloat : 459.95 µs / execution
494
+
495
+ CountedFloat is 37.3x slower than float
496
+ ```
497
+
498
+ # 6. Known limitations
463
499
 
464
500
  - currently any non-Python-built-in math operations are not counted (e.g. `numpy`)
465
- - not all Python built-in math operations are counted (e.g. `log`, `log10`, `exp`, `exp10`)
501
+ - not all Python built-in math operations are counted (e.g. hyperbolic functions)
466
502
  - flop weights should be taken with a grain of salt and should only provide relative ballpark estimates w.r.t computational complexity. Production implementations in a compiled language could have vastly differing performance depending on cpu cache sizes, branch prediction misses, compiler optimizations using vector operations (AVX etc...), etc...
467
503
 
468
504
  # Appendix A - Flop counting / analysis details
@@ -1,8 +1,8 @@
1
1
  <!--START_SECTION:images-->
2
2
  ![shields.io-python-versions](https://img.shields.io/badge/python-3.11%20%7C%203.12%20%7C%203.13-blue)
3
- ![genbadge-test-count](https://bertpl.github.io/counted-float/version_artifacts/v0.9.6/badge-test-count.svg)
4
- ![genbadge-test-coverage](https://bertpl.github.io/counted-float/version_artifacts/v0.9.6/badge-coverage.svg)
5
- ![counted_float logo](https://bertpl.github.io/counted-float/version_artifacts/v0.9.6/splash.webp)
3
+ ![genbadge-test-count](https://bertpl.github.io/counted-float/version_artifacts/v1.0.0/badge-test-count.svg)
4
+ ![genbadge-test-coverage](https://bertpl.github.io/counted-float/version_artifacts/v1.0.0/badge-coverage.svg)
5
+ ![counted_float logo](https://bertpl.github.io/counted-float/version_artifacts/v1.0.0/splash.webp)
6
6
  <!--END_SECTION:images-->
7
7
 
8
8
  # counted-float
@@ -141,30 +141,33 @@ rationale behind choice of data sources and methodology.
141
141
  >>> get_active_flop_weights().show()
142
142
 
143
143
  {
144
- FlopType.ABS [abs(x)] : 1
145
- FlopType.MINUS [-x] : 1
146
- FlopType.COMP [x<=y] : 1
147
- FlopType.RND [round] : 2
148
- FlopType.F2I [float->int] : 2
149
- FlopType.I2F [int->float] : 2
150
- FlopType.ADD [x+y] : 1
151
- FlopType.SUB [x-y] : 1
152
- FlopType.MUL [x*y] : 1
153
- FlopType.DIV [x/y] : 5
154
- FlopType.SQRT [sqrt(x)] : 6
155
- FlopType.CBRT [cbrt(x)] : 42
156
- FlopType.EXP [e^x] : 19
157
- FlopType.EXP2 [2^x] : 29
158
- FlopType.EXP10 [10^x] : 23
159
- FlopType.LOG [log(x)] : 19
160
- FlopType.LOG2 [log2(x)] : 24
161
- FlopType.LOG10 [log10(x)] : 19
162
- FlopType.POW [x^y] : 62
163
- FlopType.SIN [sin(x)] : 32
164
- FlopType.COS [cos(x)] : 31
165
- FlopType.TAN [tan(x)] : 34
144
+ FlopType.MINUS [-x] : 0.45000
145
+ FlopType.ABS [abs(x)] : 0.70000
146
+ FlopType.ADD [x+y] : 1.00000
147
+ FlopType.COMP [x<=y] : 1.00000
148
+ FlopType.SUB [x-y] : 1.00000
149
+ FlopType.MUL [x*y] : 1.40000
150
+ FlopType.RND [round] : 1.80000
151
+ FlopType.F2I [float->int] : 2.00000
152
+ FlopType.I2F [int->float] : 2.00000
153
+ FlopType.DIV [x/y] : 5.50000
154
+ FlopType.SQRT [sqrt(x)] : 7.50000
155
+ FlopType.EXP2 [2^x] : 16.00000
156
+ FlopType.EXP [e^x] : 18.00000
157
+ FlopType.LOG [log(x)] : 20.00000
158
+ FlopType.LOG2 [log2(x)] : 22.00000
159
+ FlopType.EXP10 [10^x] : 24.00000
160
+ FlopType.LOG10 [log10(x)] : 24.00000
161
+ FlopType.COS [cos(x)] : 30.00000
162
+ FlopType.SIN [sin(x)] : 30.00000
163
+ FlopType.POW [x^y] : 40.00000
164
+ FlopType.TAN [tan(x)] : 40.00000
165
+ FlopType.CBRT [cbrt(x)] : 45.00000
166
166
  }
167
167
  ```
168
+ Note that these weights are rounded up to the ~10% closest semi-round number, reflecting a balance between accuracy and readability,
169
+ while conveying the message that these weights should be used as approximations only. See further down for the different rounding modes.
170
+
168
171
  These weights will be used by default when extracting total weighted flop costs:
169
172
 
170
173
  ```python
@@ -181,7 +184,7 @@ with FlopCountingContext() as ctx:
181
184
  _ = math.log2(cf2)
182
185
 
183
186
  flop_counts = ctx.flop_counts()
184
- total_cost = flop_counts.total_weighted_cost() # 1 + 62 + 24 = 87
187
+ total_cost = flop_counts.total_weighted_cost() # 1 + 40 + 22 = 63
185
188
  ```
186
189
  Note that the `total_weighted_cost` method will use the default flop weights as returned by `get_flop_weights()`. This can be
187
190
  overridden by either configuring different flop weights (see next section) or by setting the `weights` argument of the `total_weighted_cost()` method.
@@ -208,33 +211,38 @@ Built-in flop weights can be inspected using the following functions:
208
211
  ```python
209
212
  from counted_float.config import get_default_consensus_flop_weights
210
213
 
211
- >>> get_default_consensus_flop_weights(rounded=False).show()
214
+ >>> get_default_consensus_flop_weights(rounding_mode=None).show()
212
215
 
213
216
  {
214
- FlopType.ABS [abs(x)] : 0.63673
215
- FlopType.MINUS [-x] : 0.64396
216
- FlopType.COMP [x<=y] : 1.20756
217
- FlopType.RND [round] : 1.54041
218
- FlopType.F2I [float->int] : 1.99099
219
- FlopType.I2F [int->float] : 1.84601
217
+ FlopType.MINUS [-x] : 0.46773
218
+ FlopType.ABS [abs(x)] : 0.70012
219
+ FlopType.COMP [x<=y] : 0.96923
220
+ FlopType.SUB [x-y] : 0.99846
220
221
  FlopType.ADD [x+y] : 1.00000
221
- FlopType.SUB [x-y] : 1.00586
222
- FlopType.MUL [x*y] : 1.37238
223
- FlopType.DIV [x/y] : 5.07465
224
- FlopType.SQRT [sqrt(x)] : 5.90559
225
- FlopType.CBRT [cbrt(x)] : 42.39375
226
- FlopType.EXP [e^x] : 18.58228
227
- FlopType.EXP2 [2^x] : 28.88672
228
- FlopType.EXP10 [10^x] : 22.86839
229
- FlopType.LOG [log(x)] : 18.89135
230
- FlopType.LOG2 [log2(x)] : 24.34792
231
- FlopType.LOG10 [log10(x)] : 18.55085
232
- FlopType.POW [x^y] : 61.79155
233
- FlopType.SIN [sin(x)] : 31.91490
234
- FlopType.COS [cos(x)] : 30.79295
235
- FlopType.TAN [tan(x)] : 34.37970
222
+ FlopType.MUL [x*y] : 1.39950
223
+ FlopType.RND [round] : 1.77232
224
+ FlopType.F2I [float->int] : 1.91485
225
+ FlopType.I2F [int->float] : 1.92200
226
+ FlopType.DIV [x/y] : 5.53105
227
+ FlopType.SQRT [sqrt(x)] : 7.35657
228
+ FlopType.EXP2 [2^x] : 15.85687
229
+ FlopType.EXP [e^x] : 17.51909
230
+ FlopType.LOG [log(x)] : 19.00419
231
+ FlopType.LOG2 [log2(x)] : 22.38002
232
+ FlopType.EXP10 [10^x] : 23.02693
233
+ FlopType.LOG10 [log10(x)] : 24.65718
234
+ FlopType.SIN [sin(x)] : 30.40612
235
+ FlopType.COS [cos(x)] : 31.39434
236
+ FlopType.POW [x^y] : 41.81031
237
+ FlopType.TAN [tan(x)] : 42.15636
238
+ FlopType.CBRT [cbrt(x)] : 44.32376
236
239
  }
237
240
  ```
241
+ There are 3 rounding modes:
242
+ - `None` -> no rounding
243
+ - `"nearest_int"` -> round up/down to nearest integer, with a minimum of 1
244
+ - `"10%"` -> round to nearest semi-round number within ~10% (default)
245
+
238
246
 
239
247
  The default weights that are configured out-of-the-box in the package are the integer-rounded `consensus` weights.
240
248
 
@@ -249,28 +257,28 @@ from counted_float.config import get_builtin_flop_weights
249
257
  >>> get_builtin_flop_weights(key_filter="arm").show()
250
258
 
251
259
  {
252
- FlopType.ABS [abs(x)] : 0.97313
253
- FlopType.MINUS [-x] : 0.99098
254
- FlopType.COMP [x<=y] : 1.03987
255
- FlopType.RND [round] : 1.35111
256
- FlopType.F2I [float->int] : 1.52648
257
- FlopType.I2F [int->float] : 1.63320
260
+ FlopType.COMP [x<=y] : 0.65000
261
+ FlopType.MINUS [-x] : 0.90000
258
262
  FlopType.ADD [x+y] : 1.00000
259
- FlopType.SUB [x-y] : 1.00058
260
- FlopType.MUL [x*y] : 1.44952
261
- FlopType.DIV [x/y] : 5.00897
262
- FlopType.SQRT [sqrt(x)] : 5.15597
263
- FlopType.CBRT [cbrt(x)] : 39.30448
264
- FlopType.EXP [e^x] : 17.22817
265
- FlopType.EXP2 [2^x] : 15.82232
266
- FlopType.EXP10 [10^x] : 21.20195
267
- FlopType.LOG [log(x)] : 17.51472
268
- FlopType.LOG2 [log2(x)] : 18.32529
269
- FlopType.LOG10 [log10(x)] : 17.19903
270
- FlopType.POW [x^y] : 47.63289
271
- FlopType.SIN [sin(x)] : 29.58923
272
- FlopType.COS [cos(x)] : 28.54904
273
- FlopType.TAN [tan(x)] : 31.87442
263
+ FlopType.SUB [x-y] : 1.00000
264
+ FlopType.ABS [abs(x)] : 1.10000
265
+ FlopType.F2I [float->int] : 1.50000
266
+ FlopType.MUL [x*y] : 1.50000
267
+ FlopType.I2F [int->float] : 1.60000
268
+ FlopType.RND [round] : 1.60000
269
+ FlopType.DIV [x/y] : 6.00000
270
+ FlopType.SQRT [sqrt(x)] : 7.50000
271
+ FlopType.EXP2 [2^x] : 16.00000
272
+ FlopType.EXP [e^x] : 18.00000
273
+ FlopType.LOG [log(x)] : 20.00000
274
+ FlopType.LOG2 [log2(x)] : 20.00000
275
+ FlopType.EXP10 [10^x] : 24.00000
276
+ FlopType.LOG10 [log10(x)] : 24.00000
277
+ FlopType.COS [cos(x)] : 33.00000
278
+ FlopType.SIN [sin(x)] : 33.00000
279
+ FlopType.POW [x^y] : 40.00000
280
+ FlopType.CBRT [cbrt(x)] : 45.00000
281
+ FlopType.TAN [tan(x)] : 45.00000
274
282
  }
275
283
  ```
276
284
 
@@ -314,29 +322,29 @@ div : wwwwwwwwwwwwwww.........................
314
322
  div_div : wwwwwwwwwwwwwww......................... [ 5.00 µs ± 0.2% | 20.3K cpu cycles ± 0.2% ] / 1000 iterations
315
323
  lte_addsub : wwwwwwwwwwwwwww......................... [ 1.71 µs ± 0.2% | 6.94K cpu cycles ± 0.2% ] / 1000 iterations
316
324
 
317
- >>> results.flop_weights.show()
325
+ >>> results.flop_weights().show()
318
326
 
319
327
  {
320
- FlopType.ABS [abs(x)] : 0.90556
321
- FlopType.MINUS [-x] : 0.90089
322
- FlopType.COMP [x<=y] : 1.67297
323
- FlopType.RND [round] : 1.24118
328
+ FlopType.ABS [abs(x)] : 0.89904
329
+ FlopType.MINUS [-x] : 0.90935
330
+ FlopType.SUB [x-y] : 0.99676
324
331
  FlopType.ADD [x+y] : 1.00000
325
- FlopType.SUB [x-y] : 0.99928
326
- FlopType.MUL [x*y] : 1.52656
327
- FlopType.DIV [x/y] : 4.06589
328
- FlopType.SQRT [sqrt(x)] : 5.26487
329
- FlopType.CBRT [cbrt(x)] : 39.49190
330
- FlopType.EXP [e^x] : 17.34508
331
- FlopType.EXP2 [2^x] : 16.70475
332
- FlopType.EXP10 [10^x] : 21.03351
333
- FlopType.LOG [log(x)] : 17.59412
334
- FlopType.LOG2 [log2(x)] : 18.08932
335
- FlopType.LOG10 [log10(x)] : 17.27955
336
- FlopType.POW [x^y] : 38.32044
337
- FlopType.SIN [sin(x)] : 28.67006
338
- FlopType.COS [cos(x)] : 29.11818
339
- FlopType.TAN [tan(x)] : 32.28703
332
+ FlopType.RND [round] : 1.24397
333
+ FlopType.MUL [x*y] : 1.55516
334
+ FlopType.COMP [x<=y] : 1.69018
335
+ FlopType.DIV [x/y] : 4.12333
336
+ FlopType.SQRT [sqrt(x)] : 5.42419
337
+ FlopType.EXP2 [2^x] : 16.95266
338
+ FlopType.LOG10 [log10(x)] : 17.60079
339
+ FlopType.EXP [e^x] : 17.76250
340
+ FlopType.LOG [log(x)] : 17.86149
341
+ FlopType.LOG2 [log2(x)] : 18.42380
342
+ FlopType.EXP10 [10^x] : 21.50729
343
+ FlopType.SIN [sin(x)] : 29.31571
344
+ FlopType.COS [cos(x)] : 29.56218
345
+ FlopType.TAN [tan(x)] : 32.88570
346
+ FlopType.POW [x^y] : 39.35018
347
+ FlopType.CBRT [cbrt(x)] : 40.16857
340
348
  FlopType.F2I [float->int] : nan
341
349
  FlopType.I2F [int->float] : nan
342
350
  }
@@ -438,10 +446,38 @@ ALL 0.47 0.70
438
446
 
439
447
  ```
440
448
 
441
- # 5. Known limitations
449
+ ## 4.2. Test performance of `CountedFloat` vs `float`
450
+
451
+ ```
452
+ [~] counted_float benchmark-counted-float
453
+ ```
454
+ See next section for results.
455
+
456
+ # 5. Performance impact
457
+
458
+ Obviously, using `CountedFloat` instead of regular `float` will have a performance impact due to the overhead of counting operations.
459
+ It is not advised to use `CountedFloat` for production code, but just for research code for which you want to estimate the floating-point operation count.
460
+
461
+ Micro-benchmarking of a bisection algorithm using `counted_float benchmark-counted-float` teaches us this:
462
+ ```
463
+ ------------------------------------------------------------------------------------------------------------------------
464
+ Running CountedFloat benchmark...
465
+
466
+ float : wwwwwwwwwwwwwww................................... [ 12.34 µs ± 1.2% | 50.1K cpu cycles ± 1.2% ] / execution
467
+ CountedFloat : wwwwwwwwwwwwwww................................... [ 459.95 µs ± 0.2% | 1.87M cpu cycles ± 0.2% ] / execution
468
+ ------------------------------------------------------------------------------------------------------------------------
469
+
470
+ CountedFloat Benchmark Results:
471
+ Bisection using float : 12.34 µs / execution
472
+ Bisection using CountedFloat : 459.95 µs / execution
473
+
474
+ CountedFloat is 37.3x slower than float
475
+ ```
476
+
477
+ # 6. Known limitations
442
478
 
443
479
  - currently any non-Python-built-in math operations are not counted (e.g. `numpy`)
444
- - not all Python built-in math operations are counted (e.g. `log`, `log10`, `exp`, `exp10`)
480
+ - not all Python built-in math operations are counted (e.g. hyperbolic functions)
445
481
  - flop weights should be taken with a grain of salt and should only provide relative ballpark estimates w.r.t computational complexity. Production implementations in a compiled language could have vastly differing performance depending on cpu cache sizes, branch prediction misses, compiler optimizations using vector operations (AVX etc...), etc...
446
482
 
447
483
  # Appendix A - Flop counting / analysis details
@@ -1,7 +1,7 @@
1
1
  import click
2
2
 
3
3
  from counted_float import BuiltInData
4
- from counted_float.benchmarking import run_flops_benchmark
4
+ from counted_float._core.benchmarking import run_counted_float_benchmark, run_flops_benchmark
5
5
 
6
6
 
7
7
  # -------------------------------------------------------------------------
@@ -22,3 +22,9 @@ def benchmark():
22
22
  @click.option("--key_filter", default="", help="Optional key filter for built-in data")
23
23
  def show_data(key_filter: str):
24
24
  BuiltInData.show(key_filter=key_filter)
25
+
26
+
27
+ @cli.command(short_help="run benchmark of float vs CountedFloat performance")
28
+ def benchmark_counted_float():
29
+ result = run_counted_float_benchmark()
30
+ result.show()
@@ -0,0 +1,37 @@
1
+ from .counted_float import BenchmarkCountedFloat, BenchmarkFloat, CountedFloatBenchmarkResults
2
+ from .flops import FlopsBenchmarkResults, FlopsBenchmarkSuite
3
+
4
+
5
+ def run_flops_benchmark(n_seconds_per_run_target: float = 0.1) -> FlopsBenchmarkResults:
6
+ """Run the flops benchmark suite with default settings returns a FlopsBenchmarkResults object."""
7
+
8
+ benchmark_results = FlopsBenchmarkSuite().run(n_seconds_per_run_target=n_seconds_per_run_target)
9
+
10
+ print()
11
+
12
+ return benchmark_results
13
+
14
+
15
+ def run_counted_float_benchmark(t_target_sec: float = 0.1) -> CountedFloatBenchmarkResults:
16
+ """Run benchmark to compare performance of float vs CountedFloat."""
17
+ print("-" * 120)
18
+ print("Running CountedFloat benchmark...")
19
+ print()
20
+
21
+ result_float = BenchmarkFloat().run_many(
22
+ n_runs_total=50,
23
+ n_runs_warmup=15,
24
+ n_seconds_per_run_target=t_target_sec,
25
+ )
26
+ result_counted_float = BenchmarkCountedFloat().run_many(
27
+ n_runs_total=50,
28
+ n_runs_warmup=15,
29
+ n_seconds_per_run_target=t_target_sec,
30
+ )
31
+ print("-" * 120)
32
+ print()
33
+
34
+ return CountedFloatBenchmarkResults(
35
+ float_time_nsec=result_float.summary_stats_nsecs_per_exec().q50,
36
+ counted_float_time_nsec=result_counted_float.summary_stats_nsecs_per_exec().q50,
37
+ )
@@ -0,0 +1 @@
1
+ from ._counted_float_benchmark import BenchmarkCountedFloat, BenchmarkFloat, CountedFloatBenchmarkResults