def test_liger_fused_neighborhood_attention_functional_deterministic():
    """Test that the functional interface is deterministic."""
    set_seed(42)

    batch_size, num_heads, seq_len, head_dim = 2, 4, 16, 32

    query = torch.randn(batch_size, num_heads, seq_len, head_dim, device=device)
    key = torch.randn(batch_size, num_heads, seq_len, head_dim, device=device)
    value = torch.randn(batch_size, num_heads, seq_len, head_dim, device=device)

    output1 = liger_fused_neighborhood_attention(query, key, value)
    output2 = liger_fused_neighborhood_attention(query, key, value)

    assert torch.allclose(output1, output2, atol=1e-6, rtol=1e-6), "Functional interface is not deterministic"
Test that the functional interface is deterministic.
test/transformers/test_fused_neighborhood_attention.py