Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Doc] (Compilation from source) omission or config.make file omission - not clear #397

Closed
cryolite-ai opened this issue Jun 13, 2023 · 7 comments
Labels
documentation Improvements or additions to documentation

Comments

@cryolite-ai
Copy link

📚 Documentation

Trying to follow the 'compilation from source' details section

Not sure whether elements of this belong in tvm-unity mlc-ai/relax repo?

Bug

In documentation, in block marked Configure build in config.cmake which describes the elements in the config.cmake template file to change - some of those elements are present in the config.cmake template and some are missing, leading to potential confusion as to where to put or if actually required etc.

In particular - flags referenced: set(CMAKE_BUILD_TYPE RelWithDebInfo) and set(HIDE_PRIVATE_SYMBOLS ON)

neither are currently present in the template config.cmake file which is available when using current mlc-ai/relax as per the instructions - perhaps better to have a default version in place in the file if it is important?

Thanks.

@cryolite-ai cryolite-ai changed the title [Doc] omission or config.make file omission - not clear [Doc] (Compilation from source) omission or config.make file omission - not clear Jun 13, 2023
@junrushao
Copy link
Member

junrushao commented Jun 13, 2023

Thanks for reporting this! I'd love to learn a bit further about your opinions.

To provide more context:

CMAKE_BUILD_TYPE controls the build type, where:

  • RelWithDebInfo means -O2 -g
  • Release means -O3
  • Debug means -O0 -g

HIDE_PRIVATE_SYMBOLS sets -fvisibility=hidden so that a potential symbol conflict between TVM and PyTorch are avoided (both ships with different versions of LLVM).

Note that neither of the flags are related to MLC LLM, so what do you think we should put describe them in the documentation? Happy to discuss more!

@junrushao junrushao added the documentation Improvements or additions to documentation label Jun 13, 2023
@cryolite-ai
Copy link
Author

Second thing first :-), it seems to me that it's worth putting the HIDE_PRIVATE_SYMBOLS into the config.cmake with perhaps a single comment line..

Maybe just add this to the config.cmake?

 # below sets -fvisibility=hidden to avoid potential symbol conflict between TVM / PyTorch (both ship with versions of LLVM)
 set(HIDE_PRIVATE_SYMBOLS ON)

@junrushao
Copy link
Member

@cryolite-ai sounds perfect! would you like to send a PR?

@cryolite-ai
Copy link
Author

@junrushao Lol.. I thought that might be coming ;-).. hmm, I suppose I should get into the habit.. am I right in thinking that the config.cmake stuff is in the mlc-ai/relax repo? I wouldn't normally go tinkering with compiler template settings..

@cryolite-ai
Copy link
Author

As for the CMAKE_BUILD_TYPE stuff, I realise now it is various combinations of optimisation and debug info.. funny when I read DebInfo I imagined it was some Debian packaging stuff lurking behind it..

Again, I'd be minded to just pick a default you think will be fine for most people building from source and document the rest.. partly in the file and partly in documentation.. I guess most people who actually need debug info will know to look in the build settings, so perhaps default should be Release style -O3?

If you're about to suggest a PR then, lol, again I'm going to need a tiny bit of guidance.. um, I first compiled code.. a LONG time ago... let's just say version control systems weren't much of a thing.. so git still seems exciting..

@cryolite-ai
Copy link
Author

OK, so tentative first PR above noted (mlc-ai/relax#252) - just some text adjustment/typo correction.. baby-steps..

@junrushao
Copy link
Member

Thanks! I also submitted #403 to clarify the meaning of the flags in our page

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants