halide / Halide

a language for fast, portable data-parallel computation
https://halide-lang.org
Other
5.88k stars 1.07k forks source link

user_warning "Dropping gradients at call to FUNC" is not actionable #4055

Open steven-johnson opened 5 years ago

steven-johnson commented 5 years ago

When building with the ml-autoscheduler, you'll often get a lot of buildspam of the form:

Warning:
Dropping gradients at call to shift_right
Warning:
Dropping gradients at call to reinterpret
Warning:
Dropping gradients at call to bitwise_or
Warning:
Dropping gradients at call to shift_left

(etc)

Although emitted as a "user" warning, it's likely that the typical user of the autoscheduler has no idea what this is actually warning about, whether they should be concerned, or how they can fix the warning. If we can't upgrade the text to something user actionable, we should remove it (or downgrade it to debug(1) or lower).

abadams commented 5 years ago

@BachiLi Do you think we need an explicit drop_gradients intrinsic? Or should we just silence this? What do you think it most usable for people using autodiff?

abadams commented 5 years ago

(the intrinsic would drop gradients silently)

BachiLi commented 5 years ago

It might not be a good idea to silence it just yet. In this case, I believe the dropping warnings come from the fast_log() call. It is not very obvious that some gradients would be dropped by just calling an approximate log function. Let the warnings be there by default and have an option to turn them off might be better.

steven-johnson commented 5 years ago

It is not very obvious that some gradients would be dropped by just calling an approximate log function.

Indeed, quite so! Which is the entire point of my complaint :-) The warning needs to be made actionable somehow.

abadams commented 5 years ago

fast_log should probably be lowered later than it is, like lerp