-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Closed
Labels
CIItems related to the CI tools such as CircleCI, GitHub Actions or AzureItems related to the CI tools such as CircleCI, GitHub Actions or AzureDXEverything related to making the experience of working on SciPy more pleasantEverything related to making the experience of working on SciPy more pleasant
Description
To summarize the discussion from
https://discuss.scientific-python.org/t/should-scipy-tests-assume-float64-as-the-default-floating-point-dtype/1606/8 :
- in our testing with multiple array backends, we currently configure jax to default to float64 but keep torch defaulting to float32;
- the ability to run scipy tests with either f32 or f64 default dtype is important for some of us;
- we broadly agree that inconsistent defaults are not by design;
- there is a body of tests with handcrafted tolerances depending on whether the array backend is torch or something else.
The path forward---summarizing from and slightly extending the discourse thread above:
- parametrize the array API CI job into a pair: one job sets
torch.set_default_dtype(torch.float64)
, the other does not - add a helper (
_lib
feels like a right place?) to query the default, roughly_lib.default_fp_type(xp)
which returns thexp
-specific default dtype; do not add a publicly accessible backend-agnostic way to set the default. - audit existing tests for backend-specific tolerances,
atol=1e-7 if is_torch(xp) else 1e-15
, change toif default_fp_type(xp) == xp.float32
where appropriate; - once done, make float64 the default in conftest.py
lucascolley
Metadata
Metadata
Assignees
Labels
CIItems related to the CI tools such as CircleCI, GitHub Actions or AzureItems related to the CI tools such as CircleCI, GitHub Actions or AzureDXEverything related to making the experience of working on SciPy more pleasantEverything related to making the experience of working on SciPy more pleasant