Skip to content

Commit e84985d

Browse files
committed
Change logging to logger
1 parent 9c206de commit e84985d

5 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/flag_gems/ops/baddbmm.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
from .mul import mul
1818

19+
logger = logging.getLogger(__name__)
20+
1921

2022
@libentry()
2123
@libtuner(
@@ -135,7 +137,7 @@ def baddbmm_kernel(
135137
class BaddbmmFunction(torch.autograd.Function):
136138
@staticmethod
137139
def forward(ctx, bias, A, B, beta, alpha):
138-
logging.debug("GEMS BADDBMM FORWARD")
140+
logger.debug("GEMS BADDBMM FORWARD")
139141

140142
ctx.save_for_backward(A, B, bias)
141143
ctx.alpha = alpha
@@ -176,7 +178,7 @@ def forward(ctx, bias, A, B, beta, alpha):
176178

177179
@staticmethod
178180
def backward(ctx, grad_output):
179-
logging.debug("GEMS BADDBMM BACKWARD")
181+
logger.debug("GEMS BADDBMM BACKWARD")
180182
A, B, bias = ctx.saved_tensors
181183

182184
grad_A = None

src/flag_gems/ops/fill.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def fill_tensor_(self, value):
6060

6161

6262
def fill_scalar_(self, value):
63-
logging.debug("GEMS FILL_SCALAR_")
63+
logger.debug("GEMS FILL_SCALAR_")
6464
with torch_device_fn.device(self.device):
6565
fill_scalar_func(self, value, out0=self)
6666
return self

src/flag_gems/runtime/backend/_ascend/fused/rotary_embedding.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def apply_rotary_pos_emb(
188188
q_embed: (*, q_heads, head_dim)
189189
k_embed: (*, k_heads, head_dim)
190190
"""
191-
logging.debug("GEMS_ASCEND ROTARY POS EMBEDDING")
191+
logger.debug("GEMS_ASCEND ROTARY POS EMBEDDING")
192192
assert (
193193
k.shape[-1] == q.shape[-1]
194194
), f"q and k must have the same last dimension, got {q.shape} and {k.shape}"

src/flag_gems/runtime/backend/_ascend/ops/groupnorm.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,6 @@ def group_norm_kernel(
246246

247247

248248
def group_norm(input, weight, bias, N, C, HxW, group, eps=1e-05):
249-
logging.debug("ASCEND GEMS GROUPNORM FORWARD")
250249
logger.debug("ASCEND GEMS GROUPNORM FORWARD")
251250
group_size = triton.cdiv(C, group)
252251
input = input.contiguous()
@@ -280,7 +279,6 @@ def group_norm(input, weight, bias, N, C, HxW, group, eps=1e-05):
280279
def group_norm_backward(
281280
grad_out, input, mean, rstd, weight, N, C, HxW, group, output_mask
282281
):
283-
logging.debug("ASCEND GEMS GROUPNORM BACKWARD")
284282
logger.debug("ASCEND GEMS GROUPNORM BACKWARD")
285283
grad_out = grad_out.contiguous()
286284
input = input.contiguous()

src/flag_gems/runtime/backend/_ascend/ops/hstack.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def copy_func(x):
2020
def hstack(
2121
tensors: Union[Tuple[torch.Tensor, ...], List[torch.Tensor]]
2222
) -> torch.Tensor:
23-
logging.debug("GEMS_ASCEND HSTACK")
23+
logger.debug("GEMS_ASCEND HSTACK")
2424

2525
if len(tensors) == 0:
2626
raise RuntimeError("hstack expected a non-empty TensorList")
@@ -70,4 +70,4 @@ def hstack(
7070
out_view = StridedBuffer(out0, a.shape, out0.stride(), offset=out0_offset)
7171
copy_func.instantiate(a.ndim)(in_view, out0=out_view)
7272

73-
return out0
73+
return out0

0 commit comments

Comments
 (0)