add ops - #1235
Closed
adamasWHM wants to merge 1 commit into
Closed
Conversation
tengqm
reviewed
Dec 25, 2025
| import triton.language as tl | ||
|
|
||
| from flag_gems.utils import pointwise_dynamic, tl_extra_shim | ||
| from ..utils.pointwise_dynamic import pointwise_dynamic |
Contributor
There was a problem hiding this comment.
can we do the following instead?
import from relative path is not a good practice IMHO.
from flag_gems.utils import pointwise_dynamic|
|
||
| import triton | ||
|
|
||
| from ..utils.pointwise_dynamic import pointwise_dynamic |
| return ~x | ||
|
|
||
| def bitwise_not(A): | ||
| print("ASCEND GEMS BITWISE NOT") |
Contributor
There was a problem hiding this comment.
I believe we should avoid ALL print calls in this level of source code.
| return bitwise_not_func(A) | ||
|
|
||
| def bitwise_not_(A): | ||
| print("ASCEND GEMS BITWISE NOT_") |
| raise ValueError( | ||
| "No type promotion method provided! You must provide type promotion method for each output!" | ||
| ) | ||
| else: |
Contributor
There was a problem hiding this comment.
this else: is not needed ...
| canonicalized.append( | ||
| (*arg_indices, ELEMENTWISE_TYPE_PROMOTION_KIND[method]) | ||
| ) | ||
| return canonicalized |
Contributor
There was a problem hiding this comment.
# Slower: explicit append call in a loop
new_list = []
for item in old_list:
if condition(item):
new_list.append(item)
# Faster: list comprehension
new_list = [item for item in old_list if condition(item)]| input_types = [] | ||
| for is_tensor, dtype in zip(self._is_tensor, self._dtypes): | ||
| if is_tensor: | ||
| input_types.append("StridedBuffer") |
Contributor
There was a problem hiding this comment.
Not sure if we can optimize this by giving "StridedBuffer" a shorter name.
| return self.signature(outputs_in_arg=False) | ||
|
|
||
| class KernelGenerator: | ||
| def init( |
Contributor
There was a problem hiding this comment.
should this method be __init__ ?
| """ | ||
| ) | ||
| # code.writeline("],") | ||
| # code.writeline("key=['num_tasks'],") |
Contributor
There was a problem hiding this comment.
pls remove line 244, 257, 258
| code.writeline("num_tasks: int,") | ||
|
|
||
| # tile size & tiles_per_cta, gsl style | ||
| if ndim > 0: |
Collaborator
|
@adamasWHM Do you still keep track of this PR? |
bin913
self-requested a review
May 13, 2026 11:53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
modify
PR Category
Type of Change
Description
Issue
Progress
Performance