Documentation
¶
Overview ¶
Package dutycycle computes active and idle GPU duty-cycle intervals from PM sampling streams.
This package is outside the compatibility promise of github.com/tmc/lib/nvidia. Its API may change or be removed in patch releases.
Index ¶
Examples ¶
Constants ¶
const KernelName = "duty_mma"
KernelName is the name of the kernel in Source.
const Source = `` /* 2073-byte string literal not displayed */
Source is the CUDA C duty-cycle kernel:
duty_mma(u64 *start, u64 window_ns, u64 period_ns, u64 busy_ns, float *sink)
*start must be zero before the launch; the first block to run stores %globaltimer there, and every block times its window and its periods from it. Launch at most as many blocks as are resident at once, so that none starts after the window ends.
Variables ¶
var DefaultTolerance = Tolerance{Track: 0.1, Idle: 0.05}
DefaultTolerance is ±0.1 tracking and an idle reading below 5% of full.
var ErrNotTracking = errors.New("dutycycle: counter does not track the duty cycle")
ErrNotTracking reports a counter reading that does not follow the duty cycle it was given.
Functions ¶
func Check ¶
Check reports whether points, read with the kernel running, and idle, read with no kernel resident, track their set fractions within tol. It needs a point at fraction 1 to normalize by, and one at or below 0.5 so that a counter stuck near full cannot pass.
Example ¶
package main
import (
"fmt"
"github.com/tmc/lib/nvidia/x/obs/cuptix/dutycycle"
)
func main() {
// A tensor-pipe counter that follows the kernel, then one that reports
// how long the sampling range was open.
pipe := []dutycycle.Point{{Set: 1, Measured: 61.8}, {Set: 0.5, Measured: 31.2}, {Set: 0, Measured: 0.3}}
open := []dutycycle.Point{{Set: 1, Measured: 99.9}, {Set: 0.5, Measured: 99.8}, {Set: 0, Measured: 99.9}}
fmt.Println(dutycycle.Check(pipe, 0.1, dutycycle.DefaultTolerance))
fmt.Println(dutycycle.Check(open, 0, dutycycle.DefaultTolerance))
}
Output: <nil> dutycycle: counter does not track the duty cycle: fraction 0.50 reads 0.999 of full
Types ¶
type Schedule ¶
A Schedule sets the kernel's duty cycle: busy for Busy of every Period, for Window in all.