Single-precision (fp32) build support#5033
Draft
hardik-corintis wants to merge 17 commits intofiredrakeproject:mainfrom
Draft
Single-precision (fp32) build support#5033hardik-corintis wants to merge 17 commits intofiredrakeproject:mainfrom
hardik-corintis wants to merge 17 commits intofiredrakeproject:mainfrom
Conversation
Contributor
|
Thanks for this.
What about single+complex? Isn't that a valid configuration?
This isn't necessary. That's all going to be taken care of when I release the next major version in the next 24 hours.
Can you get this fixed upstream? Clearly Claude already knows what to do. |
…spatialindex float64 coercion
- mesh.py: clarify why PETSc.RealType is correct for plex_from_cell_list - mg/kernels.py: fix to_reference_coords_kernel signature (PetscScalar *X -> %(RealType)s *X) and add RealType to the template substitution dict - evaluate.h: comment explaining why int/double is intentional for evaluate() - test_stokes_mini.py: replace fp32 solver workaround with @pytest.mark.skipsingle; fieldsplit path needs a dedicated fp32 test - conftest.py: remove trailing blank line
…nd skip VertexOnlyMesh tests in fp32
bcce0fc to
682a980
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
partially fixes #3040
Adds single-precision (fp32) build support. Firedrake can now run on a PETSc installation compiled with
--with-precision=single. The approach mirrors complex mode: precision is detected at import time from PETSc's build variables and flows through from there.Changes
scripts/firedrake-configure: adds--arch single, passes--with-precision=singleto PETSc, excludesfftw/suitesparse(no fp32 support)tsfc/parameters.py,tsfc/loopy.py:scalar_type/scalar_type_cderived from PETSc precision at import time; constant initializers cast to kernel dtypedtype=intwithIntTypeinnumpy.prodand array allocation calls; replacesdouble/intwithPetscReal/PetscIntin C generated code (evaluate.h,locate.c,pointquery_utils.py,pointeval_utils.py,mg/kernels.py); updatesutility_meshes.pyvertex coordinates toPETSc.RealType; physical coordinate arrays (rtree, swarm) stayfloat64as required by the rtree C API andDMSwarmPIC_coorsingle_modeflag tofiredrake/utils.py; adds@pytest.mark.skipsinglemarker; skips VertexOnlyMesh tests (test_locate_cell,test_interpolate_cross_mesh[extrudedcube]) and high-order warped mesh location testKnown limitations
test_parallel_high_order_locationis skipped in fp32: high-order cell location in a warped mesh requires double precision accuracy that fp32 cannot provide attolerance=0.0001.