Uh oh!
There was an error while loading. Please reload this page.
Fix distance L1 dispatch and add -fPIC to shared library builds - #1
Merged
Merged
Conversation
- distance.cpp: dt_l1 called FF_CUDA/FF_CPU::dt_euclidean instead of dt_l1 in both device branches, so the L1 transform was never invoked. - Makefile: object compile rule was missing -fPIC (shared-lib link failure). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016AjQcY78NgbagPSbPJRr6Z
Documents the layered DLPack port, the per-module status across layers, the CPU bugs fixed this pass, two CUDA/spline bugs found but not yet verifiable here, the per-module porting pattern, and a task breakdown. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016AjQcY78NgbagPSbPJRr6Z
Public ff:: sym_matvec[_backward], sym_addmatvec_, sym_submatvec_, sym_solve[_], sym_invert[_] taking DLTensor, dispatching on device to the cpu/cuda libs (cuda guarded by FF_WITH_CUDA). Makefile: add posdef to MODULES (CPU-only build links; the cuda branch is compiled only under FF_WITH_CUDA).
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 freeto 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
This PR fixes two bugs in the fastfields library and adds comprehensive migration documentation.
Key Changes
Bug Fixes
dt_l1()which was callingdt_euclideaninstead ofdt_l1for both CPU and CUDA paths-fPICflag to object compilation rule to fix shared library linking failures (relocation R_X86_64_PC32errors)Documentation
Implementation Details
The
dt_l1dispatch bug was a copy-paste error where both the CUDA and CPU branches incorrectly calleddt_euclidean. The fix ensures the L1 distance transform is actually invoked when requested.The
-fPICflag is necessary for position-independent code in shared libraries; its absence caused linker failures when buildinglibfastfields.soandlibfastfields-cpu.so.https://claude.ai/code/session_016AjQcY78NgbagPSbPJRr6Z