8. gc-hostsynclatencytest

This tool tests the sync latency between host and IPU in microseconds.

To use it, run:

gc-hostsynclatencytest -d {device_id} -j

where {device_id} is the id number returned by the gc-inventory tool.

If JSON output is selected, the output will look something like this:

{
    "ipu_id": "0",
    "sync_mode": "Polling",
    "hsp": "hsp1",
    "delay_cycles": "5",
    "num_delays": "32",
    "iterations": "1",
    "mark_count": "4095",
    "split_increments": "false",
    "time_to_sync_us": "1485",
    "result": "pass"
}

The output will be plain text if the -j option is not specified. For example:

o Using device Id - 0
o Using sync mode: Polling, HSP: hsp1
  - Issuing 4095 syncs, each followed by 32 delay instructions of 5 cycles
o Loading binary on all tiles... done
o Syncs took on average 1485 us
o Result - Pass

If an error occurs during the test, then gc-hostsynclatencytest will return a non-zero exit code, and output an error message to the stdout.

More iterations can be added using the -i option to average the results to reduce the impact of system process scheduling.

When the host syncs with the IPUs it can set a “mark count”. This is decremented every time the IPUs sync. There is a host function that will wait until the mark count hits zero. gc-hostsynclatencytest can set the initial value of the mark count and request the IPUs to issue a series of syncs. It then measures the time it takes for the mark count to reach zero.

A larger number of delay cycles, number of delays or value of mark count will result in longer load time onto the tiles of the IPU.

8.1. Usage

8.1.1. Allowed options

-d {arg}, --device-id {arg}

IPU device Id to be used

--which-hsp {arg}

hsp1|hsp2|both (default: hsp1)

-i {arg}, --iterations {arg}

Iterations (default: 1)

--split-increment

Split mark count increment into two calls

-m {arg}, --sync-mode {arg}

posted|polling|hybrid (default: polling)

--delay-val {arg}

Number of cycles for delay instruction. Max is 20 (default: 5)

--delay-num {arg}

Number of delay instructions (default: 32)

-c {arg}, --mark-count {arg}

Initial value of mark-count (default: 4095)

--multiple-sync-groups

split MultiIPU device into separate sync groups

-v, --verbose

Verbose output

-j, --json-output

Emit JSON output

-h, --help

Produce help message

--version

Version number