You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are currently limited checks on the validity of TimeFunctions that use ConditionalDimension, which can result in OOB errors when running operators that are often difficult to track for users.
This is a Slack conversation with @FabioLuporini about the issue:
At op.arguments time (which, I remind you, is called via op.apply), _arg_check is called for each object in op.parameters to perform, as the name suggests, error checks. The intervals data structure, which in essence captures the extent of the iteration spaces, is part of its interface and could be used along with the args values to detect a potential OOB in the case self.time_dim is a ConditionalDimension.
The various _arg_check s perform a number of checks, and we could enhance them if we think it might be of help here. The only catch here is that I don’t know whether intervals provides sufficient information.
what I have in mind:
let self be a TimeFunction over a ConditionalDimension with factor F
if intervals[self.time_dim] returns something like A = (1, 1)
and we calculate from args that the time iteration extent is X ( == time_M - time_m + 1)
and see that self.shape_allocated[self.time_dim] is Y
at this point, if (X + A.right + A.left) / F >= Y (aka (X + 2) / F >= Y), then we will have an OOB at runtime (probably needs some mod/max/min to make sure to handle the bounds of the formula correctly), and we should raise a warning or even an InvalidArgument exception (if we are absolutely certain this is an error)
The text was updated successfully, but these errors were encountered:
There are currently limited checks on the validity of
TimeFunction
s that useConditionalDimension
, which can result in OOB errors when running operators that are often difficult to track for users.This is a Slack conversation with @FabioLuporini about the issue:
If we want to hint the user about a potential user-level error, we should (could) raise one or more warnings at
op.arguments
(op.apply
) time through the_arg_check
method. Example: https://github.com/devitocodes/devito/blob/master/devito/types/dense.py#L1418At
op.arguments
time (which, I remind you, is called viaop.apply
),_arg_check
is called for each object inop.parameters
to perform, as the name suggests, error checks. Theintervals
data structure, which in essence captures the extent of the iteration spaces, is part of its interface and could be used along with theargs
values to detect a potential OOB in the caseself.time_dim
is aConditionalDimension
.The various
_arg_check
s perform a number of checks, and we could enhance them if we think it might be of help here. The only catch here is that I don’t know whetherintervals
provides sufficient information.what I have in mind:
self
be aTimeFunction
over aConditionalDimension
with factorF
intervals[self.time_dim]
returns something likeA = (1, 1)
args
that the time iteration extent isX
( ==time_M - time_m + 1
)self.shape_allocated[self.time_dim]
isY
(X + A.right + A.left) / F >= Y
(aka(X + 2) / F >= Y
), then we will have an OOB at runtime (probably needs some mod/max/min to make sure to handle the bounds of the formula correctly), and we should raise a warning or even anInvalidArgument
exception (if we are absolutely certain this is an error)The text was updated successfully, but these errors were encountered: