Repository navigation
Conversation
…ss-barrier CSE leakage
Author
|
Closing this PR: string-matching output name suffixes in |
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.
Summary
Caspar factor kernels generate outputs in distinct mathematical blocks separated by shared-memory reductions (
FlushSumShared) and warp synchronizations:out_res,out_rTr)out_pose_jac,out_pose_njtr,out_pose_precond_*)out_calib_jac,out_calib_njtr,out_calib_precond_*)out_point_jac,out_point_njtr,out_point_precond_*)Currently, a single flat
expr_mapis shared across all outputs. Common subexpressions are reused globally without barrier awareness. For example, in aSimpleRadialfactor,calib_factor = -1.0 * (1 + k*r^2)was first computed duringout_pose_jacintor54and reused 350 lines later duringout_calib_njtracross 12FlushSumSharedcalls.Under
__launch_bounds__(1024, 1)in double precision, this 350-line cross-barrier live range triggered massive register spilling and stack slot clobbering in NVCC, causing calibration derivatives to diverge in COLMAP (see colmap/colmap#4799).This PR scopes
expr_mapper output parameter group:base_expr_mapstores read input symbols (camera pose, calibration parameters, 3D points, 2D pixels).pose->calib->point),expr_mapis reset tobase_expr_map.This preserves full CSE within each parameter block while preventing intermediate derivative expressions from leaking across reduction barriers into subsequent parameter blocks.
Test Plan