Skip to content

Make CUDA lineinfo optional.#11606

Merged
hcho3 merged 1 commit into
dmlc:masterfrom
trivialfis:remove-lineinfo
Aug 5, 2025
Merged

Make CUDA lineinfo optional.#11606
hcho3 merged 1 commit into
dmlc:masterfrom
trivialfis:remove-lineinfo

Conversation

@trivialfis
Copy link
Copy Markdown
Member

@trivialfis trivialfis commented Aug 4, 2025

Ref #11604 .

Before:

$ strip libxgboost.so 
$ du -h libxgboost.so 
445M    libxgboost.so

After:

$ strip libxgboost.so 
$ du -h libxgboost.so 
148M    libxgboost.so

@trivialfis
Copy link
Copy Markdown
Member Author

cc @hcho3

@trivialfis trivialfis requested a review from hcho3 August 4, 2025 17:18
Comment thread cmake/Utils.cmake
Comment on lines -115 to -117
else()
target_compile_options(${target} PRIVATE
$<$<COMPILE_LANGUAGE:CUDA>:-lineinfo>)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can we create a new CMake option to enable the lineinfo? Or is it redundant given the USE_DEVICE_DEBUG option?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It's redundant when debug mode is enabled.

After this PR , it will be enabled when nvtx is enabled since the lineinfo is most relevant for profiling.

Please note that, it's not necessary to enable nvtx for profiling. I'm just grouping them under one flag.

We can remove this nvcc flag entirely and rely on the user to supply a cmake compiler flag. I don't have a strong opinion on this choice, remove the flag, split up the flag, or group the flag under nvtx.

@hcho3 hcho3 merged commit dcf8afe into dmlc:master Aug 5, 2025
85 of 88 checks passed
@trivialfis trivialfis deleted the remove-lineinfo branch August 5, 2025 13:19
@hcho3
Copy link
Copy Markdown
Collaborator

hcho3 commented Aug 5, 2025

I ran some experiments on my end.

CMake options: -DUSE_DLOPEN_NCCL=ON -DPLUGIN_FEDERATED=OFF (all SMs enabled)

Before (e4406da):

  • Uncompressed: 832 MB
  • Compressed: 572 MB

After (dcf8afe):

  • Uncompressed: 257 MB (70% savings)
  • Compressed: 167 MB (70% savings)

trivialfis added a commit to trivialfis/xgboost that referenced this pull request Aug 11, 2025
trivialfis added a commit to trivialfis/xgboost that referenced this pull request Aug 11, 2025
@trivialfis trivialfis mentioned this pull request Aug 7, 2025
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants