Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion benchmarks/attention/benchmark_attention_rocm.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@
trimmed_path = cwd[:index]
sys.path.append(trimmed_path)

from tests.pytorch.fused_attn.test_fused_attn import (
# Add path to tests directory
tests_path = os.path.abspath(
os.path.join(os.path.dirname(__file__), "../../tests/pytorch/fused_attn")
)
sys.path.append(tests_path)

from test_fused_attn import (
ModelConfig,
_get_attention_backends,
_run_dot_product_attention,
Expand Down
10 changes: 9 additions & 1 deletion docs/examples/attention/arbitrary_mask_to_post_scale_bias.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,17 @@
# See LICENSE for license information.

import os
import sys
import torch
from typing import Tuple
from tests.pytorch.fused_attn.test_fused_attn import ModelConfig

# Add path to tests directory
tests_path = os.path.abspath(
os.path.join(os.path.dirname(__file__), "../../../tests/pytorch/fused_attn")
)
sys.path.append(tests_path)

from test_fused_attn import ModelConfig
from transformer_engine.pytorch.attention import DotProductAttention

# Initialize RNG state
Expand Down
Loading