Skip to content
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

Flaky runtime/test_launch.py::test_memory_leak #3007

Open
pbchekin opened this issue Dec 12, 2024 · 1 comment · May be fixed by #3077
Open

Flaky runtime/test_launch.py::test_memory_leak #3007

pbchekin opened this issue Dec 12, 2024 · 1 comment · May be fixed by #3077
Assignees
Labels
bug Something isn't working tests: ut

Comments

@pbchekin
Copy link
Contributor

_______________________________ test_memory_leak _______________________________

device = 'xpu'

    def test_memory_leak(device) -> None:
    
        @triton.jit
        def kernel(in_ptr0, out_ptr0, xnumel, XBLOCK: tl.constexpr):
            xnumel = 10
            xoffset = tl.program_id(0) * XBLOCK
            xindex = xoffset + tl.arange(0, XBLOCK)[:]
            xmask = xindex < xnumel
            x0 = xindex
            tmp0 = tl.load(in_ptr0 + (x0), xmask)
            tl.store(out_ptr0 + (x0 + tl.zeros([XBLOCK], tl.int32)), tmp0, xmask)
    
        tracemalloc.start()
        try:
            inp = torch.randn(10, device=device)
            out = torch.randn(10, device=device)
            kernel[(10, )](inp, out, 10, XBLOCK=16)
            gc.collect()
            begin, _ = tracemalloc.get_traced_memory()
            for _ in range(100):
                kernel[(10, )](inp, out, 10, XBLOCK=16)
            gc.collect()
            end, _ = tracemalloc.get_traced_memory()
>           assert end - begin < 30000
E           assert (79991 - 37617) < 30000

runtime/test_launch.py:69: AssertionError

Examples:

@pbchekin pbchekin added the bug Something isn't working label Dec 12, 2024
@pbchekin
Copy link
Contributor Author

Python 3.10, 3.11, 3.12 but looks like there are no cases with Python 3.9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working tests: ut
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants