triton.language.device_assert
- triton.language.device_assert(cond, msg='', _builder=None)
Assert the condition at runtime from the device. Requires that the environment variable
TRITON_DEBUGis set to a value besides0in order for this to have any effect.Using the Python
assertstatement is the same as calling this function, except that the second argument must be provided and must be a string, e.g.assert pid == 0, "pid != 0". The environment variable must be set for thisassertstatement to have any effect.tl.device_assert(pid == 0) assert pid == 0, f"pid != 0"
- Parameters:
cond – the condition to assert. This is required to be a boolean tensor.
msg – the message to print if the assertion fails. This is required to be a string literal.