-
Notifications
You must be signed in to change notification settings - Fork 38
[Build] Add FlagtreeConfig Class for triton_v3.4.x #342
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
base: triton_v3.4.x
Are you sure you want to change the base?
Conversation
python/setup_tools/utils/aipu.py
Outdated
| default_backends_list = list(default_backends) | ||
| default_backends_list.append('flir') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace it by
| default_backends_list = list(default_backends) | |
| default_backends_list.append('flir') | |
| default_backends_list = [*default_backends, "flir"] |
Would this be more readable?
python/setup_tools/utils/aipu.py
Outdated
| default_backends_list.append('flir') | ||
| kargs["default_backends"] = tuple(default_backends_list) | ||
| default_backends = tuple(default_backends_list) | ||
| return default_backends No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Append an "\n" to the file end.
python/setup_tools/utils/tools.py
Outdated
| object.__setattr__( | ||
| self, | ||
| "flagtree_submodule_dir", | ||
| os.path.join(self.flagtree_root_dir, "third_party"), | ||
| ) | ||
| object.__setattr__(self, "activated_module", self._activate_device_module(self.flagtree_backend)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why cannot we set attribute directly here?
python/setup_tools/utils/tools.py
Outdated
| object.__setattr__(self, "activated_module", self._activate_device_module(self.flagtree_backend)) | ||
|
|
||
| def _activate_device_module(self, backend, suffix=".py"): | ||
| backend = "default" if not backend else backend |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| backend = "default" if not backend else backend | |
| backend = backend or "default" |
python/setup_tools/utils/tools.py
Outdated
| module = importlib.util.module_from_spec(spec) | ||
| try: | ||
| spec.loader.exec_module(module) | ||
| except Exception: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't "except Exception" here directly. That would make us lose other unexpected errors. Check the possible exception types here and assign specific ones.
d1390e6 to
c85124c
Compare
modified: python/setup_tools/utils/tools.py
modified: python/setup_tools/utils/tools.py
Refactor _activate_device_module to set backend internally
modified: python/setup_tools/utils/tools.py
No description provided.