Bug report: Inconsistent FP16 FLOP factors between Nsight Compute Python rule and roofline section

I noticed an apparent inconsistency in how scalar FP16 operations are counted between the Nsight Compute Python rule SpeedOfLight_TotalCompute.py and the half-precision roofline section.

In SpeedOfLight_TotalCompute.py, line 94–97, scalar FP16 throughput is computed as:

hadd = _metric_val(metrics, "hadd")
hmul = _metric_val(metrics, "hmul")
hfma = _metric_val(metrics, "hfma")
achieved_fp16_per_cycle = hadd + hmul + 4.0 * hfma

where the metrics are:

smsp__sass_thread_inst_executed_op_hadd_pred_on.sum.per_cycle_elapsed
smsp__sass_thread_inst_executed_op_hmul_pred_on.sum.per_cycle_elapsed
smsp__sass_thread_inst_executed_op_hfma_pred_on.sum.per_cycle_elapsed

This applies factors 1, 1, 4 for HADD, HMUL, and HFMA.

However, in SpeedOfLight_HierarchicalHalfRooflineChart.section, the corresponding derived metrics appear to use factors 2, 2, 4:

derived__smsp__sass_thread_inst_executed_op_hadd_pred_on_x2
  = smsp__sass_thread_inst_executed_op_hadd_pred_on.sum.per_cycle_elapsed * 2

derived__smsp__sass_thread_inst_executed_op_hmul_pred_on_x2
  = smsp__sass_thread_inst_executed_op_hmul_pred_on.sum.per_cycle_elapsed * 2

derived__smsp__sass_thread_inst_executed_op_hfma_pred_on_x4
  = smsp__sass_thread_inst_executed_op_hfma_pred_on.sum.per_cycle_elapsed * 4

I do not see any hidden scaling in _metric_val; it appears to only return float(m.value()). So the Python rule seems to count scalar FP16 HADD and HMUL at half the factor used by the roofline section.

Could you confirm whether SpeedOfLight_TotalCompute.py should use:

achieved_fp16_per_cycle = 2.0 * hadd + 2.0 * hmul + 4.0 * hfma

to match the half-precision roofline convention?

If the two files are intentionally using different definitions, could you clarify the intended distinction between “FP16 FLOP/s” in the total compute rule and “half precision operations” in the roofline section?

Nsight Compute version: 2026.1.1.0 (build 37693799) (public-release)

Hi, @singularitti

Nsight Compute do not have this script delivered. Is this created by you or someone else ?

Oh, it was created by me. Sorry for the trouble.