constants.py 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # Copyright (c) Microsoft Corporation.
  2. # SPDX-License-Identifier: Apache-2.0
  3. # DeepSpeed Team
  4. #########################################
  5. # flops profiler
  6. #########################################
  7. # Flops profiler. By default, this feature is not enabled.
  8. # Users can configure in ds_config.json as below example:
  9. FLOPS_PROFILER_FORMAT = '''
  10. flops profiler should be enabled as:
  11. "session_params": {
  12. "flops_profiler": {
  13. "enabled": true,
  14. "recompute_fwd_factor": 0.0,
  15. "profile_step": 1,
  16. "module_depth": -1,
  17. "top_modules": 3,
  18. "detailed": true,
  19. "output_file": null
  20. }
  21. }
  22. '''
  23. FLOPS_PROFILER = "flops_profiler"
  24. FLOPS_PROFILER_ENABLED = "enabled"
  25. FLOPS_PROFILER_ENABLED_DEFAULT = False
  26. FLOPS_PROFILER_RECOMPUTE_FWD_FACTOR = "recompute_fwd_factor"
  27. FLOPS_PROFILER_RECOMPUTE_FWD_FACTOR_DEFAULT = 0.0
  28. FLOPS_PROFILER_PROFILE_STEP = "profile_step"
  29. FLOPS_PROFILER_PROFILE_STEP_DEFAULT = 1
  30. FLOPS_PROFILER_MODULE_DEPTH = "module_depth"
  31. FLOPS_PROFILER_MODULE_DEPTH_DEFAULT = -1
  32. FLOPS_PROFILER_TOP_MODULES = "top_modules"
  33. FLOPS_PROFILER_TOP_MODULES_DEFAULT = 1
  34. FLOPS_PROFILER_DETAILED = "detailed"
  35. FLOPS_PROFILER_DETAILED_DEFAULT = True
  36. FLOPS_PROFILER_OUTPUT_FILE = "output_file"
  37. FLOPS_PROFILER_OUTPUT_FILE_DEFAULT = None