-
Notifications
You must be signed in to change notification settings - Fork 61
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
Support dumping training logs for TensorBoard visualization toolkit. #1144
base: main
Are you sure you want to change the base?
Conversation
Add a TensorBoard tracker that will save training loss, validation scores and test scores into TensorBoard logs.
To support optional dependencies we do the following @classicsong Pandas has their own Optional imports are done inline, using something like def generate_numba_apply_func(
func, nogil=True, nopython=True, parallel=False
) -> Callable[[npt.NDArray, Index, Index], dict[int, Any]]:
numba = import_optional_dependency("numba")
jitted_udf = numba.extending.register_jitable(func) So in this case we could do class GSTensorBoardTracker(GSSageMakerTaskTracker):
def __init__(self, log_report_frequency, log_dir=None):
super().__init__(log_report_frequency, log_dir)
try:
tensorboard = importlib.import_module("torch.utils.tensorboard")
except ImportError as err:
msg = (
"GSTensorBoardTracker requires tensorboard to run. "
"Please install the tensorboard Python package.")
raise ImportError(msg) from err
self._writer = tensorboard.SummaryWriter(log_dir) This ensures we only try to pull the dependency if we try to instantiate a Then we can modify our setup.py to include tensorboard as an extra dependency: setup(
# Metadata
name='graphstorm',
version=VERSION,
python_requires='>=3.8',
description='GraphStorm',
long_description_content_type='text/markdown',
license='Apache-2.0',
# Package info
packages=find_packages(where="python", exclude=(
'tests',
)),
package_dir={"": "python"},
package_data={'': [os.path.join('datasets', 'dataset_checksums', '*.txt')]},
zip_safe=True,
include_package_data=True,
install_requires=requirements,
ext_modules=extensions,
cmdclass=cmdclass,
extras_require={
'visualization': [
'tensorboard', # Add minimum version if needed, e.g. 'tensorboard>=2.11.2'
]
},
) then when users want tensorboard visualization they can install |
…ndency (#1146) *Issue #, if available:* #988 *Description of changes:* Follow #1144 to update graphstorm dependency. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. Co-authored-by: Xiang Song <[email protected]>
Issue #, if available:
#988
Description of changes:
Add a TensorBoard tracker that will save training loss, validation scores and test scores into TensorBoard logs.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.