Fix enable_validation#2201
Conversation
|
@fehiepsi : shall we keep |
|
We decided to enable validation by default. I think setting the attribute to the global one might fix the issue. |
juanitorduz
left a comment
There was a problem hiding this comment.
Minor point, right @Qazalbash ?
| from . import constraints | ||
|
|
||
| _VALIDATION_ENABLED = True | ||
| _VALIDATION_ENABLED = False |
There was a problem hiding this comment.
Based on the comment above, we should keep _VALIDATION_ENABLED = True
There was a problem hiding this comment.
This is fixed. Note that this changes the behavior by default and might be a breaking change for some codebases. However, I find that it is much better to have validation enabled by default, as it was quite unintuitive in the first place.
Qazalbash
left a comment
There was a problem hiding this comment.
@juanitorduz Yes, the global variable value should be reverted.
Qazalbash
left a comment
There was a problem hiding this comment.
Thanks @renecotyfanboy
|
I think CI will trigger after @juanitorduz approves. Let's merge this PR only when the latest CI passes. |
|
@renecotyfanboy thanks! Can you push an empty commit (e.g., git commit -m"empty" --allow-empty ) to try to trigger the CI? 🙏 |
|
Enabling validation by default broke some tests in the CI. Should I simply wrap them around |
|
Let's leave things as they were. What do you say @juanitorduz? |
This reverts commit c66e2fb.
|
Could we fix the tests instead? This indicates that we might not use correct params for those tests. |
|
Indeed, that is a better approach! I could help fix these tests if you feel tuck @renecotyfanboy :) |
|
I started fixing a bunch of tests here.
However, I see that it is taking a super long time for me to look at each case, each distribution, and find what is ill-defined in the parameter used in space or in the batch / event shape mismatch. If I am to continue fixing the test, I will probably switch to LLMs to iterate faster. |
|
Thank you @renecotyfanboy ! I think Claude (or similar) can be super useful here! If you need some help please let me know :) |
Hi there,
Here is a super small fix for validation. Currently, the validation context is handled using
_VALIDATION_ENABLEDglobal variable. By default_VALIDATION_ENABLED=Trueand_validate_args=Falseby default, which trigger weird behaviors when enabling / disabling the validation through contexts. But since everything is handled through mutating_VALIDATION_ENABLED, it sometimes produces weird behaviors.The simplest repro is :
The current fix produces the expected behavior.