Closed ksivaman closed 3 months ago
/te-ci
Hmmm, TBH I don't understand why we don't just put that getenv template in the header file instead of the cpp file and just use that in the extensions rather than relying on the precompiled version.
Hmmm, TBH I don't understand why we don't just put that getenv template in the header file instead of the cpp file and just use that in the extensions rather than relying on the precompiled version.
This is not a bad idea either. This function is small, so explicit template instantiation doesn't save us much in terms of compilation time or binary size: https://github.com/NVIDIA/TransformerEngine/blob/0edf30b87159e82048b5f248e4b379aebb8f364a/transformer_engine/common/util/system.cpp#L58-L70
Description
This is a cleaner workaround for undefined symbol errors for
transformer_engine::getenv
in the PyTorchCUDAExtension
for which previouslysystem.cpp
from the common lib was being included as a source file in the framework build. We still need to be mindful when usinggetenv
in the framework extensions henceforth with T asstring
orfilesystem::path
since this would also be the return type and would lead to the same errors.Type of change
Changes
Changes
transformer_engine::getenv
to useconst char*
arg instead ofstd::string
argument.Checklist: