tests: harden memory leak check in test_siblings_without_eval (#3088)
Signed-off-by: Ihar Hrachyshka <[email protected]>
This commit is contained in:
@@ -12,12 +12,12 @@ runs:
|
||||
run: |
|
||||
pip install --upgrade pip
|
||||
pip install cmake setuptools typing_extensions
|
||||
pip install -e . -v
|
||||
pip install -e ".[dev]" -v
|
||||
|
||||
- name: Install tests dependencies
|
||||
shell: bash -l {0}
|
||||
run: |
|
||||
pip install numpy torch tensorflow
|
||||
pip install tensorflow
|
||||
|
||||
- name: Run Python tests
|
||||
shell: bash -l {0}
|
||||
|
||||
@@ -11,14 +11,10 @@ import weakref
|
||||
from copy import copy, deepcopy
|
||||
from itertools import permutations
|
||||
|
||||
if platform.system() == "Windows":
|
||||
import psutil
|
||||
else:
|
||||
import resource
|
||||
|
||||
import mlx.core as mx
|
||||
import mlx_tests
|
||||
import numpy as np
|
||||
import psutil
|
||||
|
||||
try:
|
||||
import tensorflow as tf
|
||||
@@ -2087,11 +2083,8 @@ class TestArray(mlx_tests.MLXTestCase):
|
||||
|
||||
def test_siblings_without_eval(self):
|
||||
def get_mem():
|
||||
if platform.system() == "Windows":
|
||||
process = psutil.Process(os.getpid())
|
||||
return process.memory_info().peak_wset
|
||||
else:
|
||||
return resource.getrusage(resource.RUSAGE_SELF).ru_maxrss
|
||||
process = psutil.Process(os.getpid())
|
||||
return process.memory_info().rss
|
||||
|
||||
key = mx.array([1, 2])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user