Skip to content

Merge two optimization-based (NSFP, FastNSF) methods into codebase from HiMo project#14

Merged
Kin-Zhang merged 18 commits intoKTH-RPL:mainfrom
Kin-Zhang:feature/himo_baseline
Aug 11, 2025
Merged

Merge two optimization-based (NSFP, FastNSF) methods into codebase from HiMo project#14
Kin-Zhang merged 18 commits intoKTH-RPL:mainfrom
Kin-Zhang:feature/himo_baseline

Conversation

@Kin-Zhang
Copy link
Copy Markdown
Member

@Kin-Zhang Kin-Zhang commented Aug 9, 2025

This pull request introduces two new models, NSFP and FastNSF, into the codebase, along with their configuration files and supporting infrastructure. These are part of the HiMo project's benchmark code.

Model Integration

  • Added the NSFP and FastNSF models, including their full implementations in src/models/nsfp.py and src/models/fastnsf.py, enabling new scene flow estimation methods. [1] [2]
  • Updated src/models/__init__.py to register both models for import, with informative warnings if their dependencies are missing. [1] [2]

Configuration

  • Added configuration files for both models: conf/model/nsfp.yaml and conf/model/fastnsf.yaml, specifying hyperparameters and training settings. [1] [2]

CUDA Extension

  • NSFP Chamfer distance is calculated from our chamfer distance, which can speed up NSFP 3x faster than the original version. Check more on the testing README. The performance is similar. Here are the leaderboard result file.

TBD

  • Tested on single gpu and align the results.
  • Tested on multi-gpu to check if it's speed-up successfully.
  • Update docker image to cuda-11.8 and py310 for afterward torch upgrading etc. Need a double check.
  • Update README to specific how to run those methods. (maybe a wiki page like https://github.com/KTH-RPL/DynamicMap_Benchmark I did before?
  • Test optimization-based test/leaderboard-mode file if it's good.
  • Test optimization-based test/leaderboard-mode output in multi-gpu.
    ...

Other notes: another optimization-based method (ICP-Flow) will be merged by another new pull request where I will ask Yancong (original author) to review the ICP-Flow pull request.

@Kin-Zhang Kin-Zhang requested a review from Copilot August 9, 2025 21:07
@Kin-Zhang Kin-Zhang self-assigned this Aug 9, 2025
@Kin-Zhang Kin-Zhang added the new method new method involve label Aug 9, 2025

This comment was marked as outdated.

* try to speed up if we have more gpus, but I haven't test on multi-gpu and multi-node session. Will test later once I got the setup.
* upgrade training env to python 3.10 and with cuda 11.8 for afterward env upgrading etc.
* and fix typo from copilot reviewers.
@Kin-Zhang Kin-Zhang requested a review from Copilot August 9, 2025 21:15
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR integrates two optimization-based scene flow estimation methods (NSFP and FastNSF) from the HiMo project into the existing codebase. The integration includes custom CUDA optimizations for improved performance and a new distributed inference runner to handle optimization-based models.

Key changes:

  • Added NSFP and FastNSF model implementations with unified interface
  • Implemented distributed inference runner for optimization-based methods
  • Updated build configuration and dependency management

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
src/runner.py New distributed inference runner replacing PyTorch Lightning for optimization-based models
src/models/nsfp.py NSFP model implementation with CUDA-accelerated Chamfer distance
src/models/fastnsf.py FastNSF model implementation using FastGeodis for distance transforms
src/models/basic/nsfp_module.py Added weight initialization methods to Neural_Prior class
src/models/init.py Model registration with graceful handling of missing dependencies
conf/model/nsfp.yaml Configuration file for NSFP hyperparameters
conf/model/fastnsf.yaml Configuration file for FastNSF hyperparameters

@Kin-Zhang Kin-Zhang changed the title Merge two new optimization-based (NSFP, FastNSF) method into codebase from HiMo project Merge two optimization-based (NSFP, FastNSF) method into codebase from HiMo project Aug 9, 2025
@Kin-Zhang Kin-Zhang changed the title Merge two optimization-based (NSFP, FastNSF) method into codebase from HiMo project Merge two optimization-based (NSFP, FastNSF) methods into codebase from HiMo project Aug 9, 2025
@Kin-Zhang
Copy link
Copy Markdown
Member Author

For FastNSF dependencies FastGeodis, the installation might have problem as shown here:

      /home/qingwen/miniforge3/envs/opensf/include/python3.8/Python.h:44:10: fatal error: crypt.h: No such file or directory
         44 | #include <crypt.h>
            |          ^~~~~~~~~
      compilation terminated.

Reference to this issue. Manually solve by in my setup:

(opensf) ➜  cp /usr/include/crypt.h /home/qingwen/miniforge3/envs/opensf/include/python3.8 
(opensf) ➜  pip install FastGeodis --no-build-isolation --no-cache-dir                    

@Kin-Zhang
Copy link
Copy Markdown
Member Author

Kin-Zhang commented Aug 10, 2025

[GPU 0] Processing 25e5c600-36fe-3245-9cc0-40ef91620c22:  77%|██████ | 24/31 [02:22<00:32,  4.60s/it]
[GPU 1] Processing 3b3570b4-7b0b-3268-a571-b0889dbf40b6:  74%|██████ | 23/31 [02:21<00:47,  5.95s/it]

Looks good for multi-gpu running on one node. (2x2080Ti, NSFP; VRAM: ~2G/gpu) where I noticed that the full cpu run.

A **demo** result screenshot with timer on **only 2 scenes**, this is NOT THE FULL validation set. 2025-08-10_11-45

Kin-Zhang and others added 7 commits August 10, 2025 11:48
* need set cuda device during spawn.
* apply coplit pull request review.
* finished checking on 2-gpu setting. (but not yet test on multi-nodes)
…r if we already have torch.

* as dockerfile shown.
* update env file (check all good)
* update dockerfile
…ion.

* fix some issues on test on runner
* but haven't test it on multi-gpu.
@Kin-Zhang
Copy link
Copy Markdown
Member Author

Kin-Zhang commented Aug 10, 2025

Almost finished, the final thing to check is about the multi-gpu test-mode output file to see if it can zip successfully at the end.


save-mode also works well and results are correct.
image

* visualization result also checked, corrected.
* todo tested on multi-gpu to see if it works.
@Kin-Zhang Kin-Zhang force-pushed the feature/himo_baseline branch from 0f14594 to abccd67 Compare August 10, 2025 22:08
* style(header): update header info.
@Kin-Zhang Kin-Zhang merged commit 3d53932 into KTH-RPL:main Aug 11, 2025
@Kin-Zhang Kin-Zhang deleted the feature/himo_baseline branch August 11, 2025 18:50
@Kin-Zhang Kin-Zhang restored the feature/himo_baseline branch August 11, 2025 18:52
@Kin-Zhang Kin-Zhang deleted the feature/himo_baseline branch September 25, 2025 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new method new method involve

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants