sacs-epfl/decentralized-learning-simulator

The AD-PSGD tests seem to be broken

Opened this issue · 0 comments

(base) martijndevos@iMacvanMartijn decentralized-learning-simulator % pytest tests/test_adpsgd.py -x
========================================================================================================================================================================== test session starts ===========================================================================================================================================================================
platform darwin -- Python 3.10.7, pytest-7.1.2, pluggy-1.0.0
rootdir: /Users/martijndevos/Documents/decentralized-learning-simulator
plugins: anyio-3.6.1, asyncio-0.19.0, timeout-2.1.0
asyncio: mode=strict
collected 64 items                                                                                                                                                                                                                                                                                                                                                       

tests/test_adpsgd.py F

================================================================================================================================================================================ FAILURES ================================================================================================================================================================================
__________________________________________________________________________________________________________________________________________________________________________ test_adpsgd[20-10-0] __________________________________________________________________________________________________________________________________________________________________________

seed = 0, participants = 10, duration = 20, session_settings = SessionSettings(algorithm='adpsgd', seed=0, work_dir=local('/private/var/folders/hn/fdqtlxhd189bx56z84y34xqh0000gn/T/p...ounds', wait=False, el='oracle', k=0, no_weights=False, stragglers_proportion=0.0, stragglers_ratio=0.1, sample_size=0)

    @pytest.mark.asyncio
    @pytest.mark.parametrize("seed", [0, 1, 2, 3])
    @pytest.mark.parametrize("participants", [10, 50, 100, 200])
    @pytest.mark.parametrize("duration", [20, 100, 500, 1000])
    async def test_adpsgd(seed, participants, duration, session_settings):
        session_settings.duration = duration
        session_settings.seed = seed
        session_settings.participants = participants
        sim = ADPSGDSimulation(session_settings)
        await sim.run()
>       sanity_check(session_settings.participants, sim.workflow_dag)

tests/test_adpsgd.py:63: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

participants = 10, workflow_dag = <dasklearn.tasks.dag.WorkflowDAG object at 0x144dc7df0>

    def sanity_check(participants: int, workflow_dag):
        compute_gradient_init = 0
        gradient_update_init = 0
        for task_name, task in workflow_dag.tasks.items():
            if task.func == "compute_gradient":
                assert len(task.inputs) <= 1
                if len(task.inputs) == 0:
                    compute_gradient_init += 1
                else:
                    assert task.inputs[0].func in ["aggregate", "gradient_update"]
            elif task.func == "gradient_update":
                assert len(task.inputs) == 2 or len(task.inputs) == 1
                if len(task.inputs) == 1:
                    gradient_update_init += 1
            elif task.func == "aggregate":
                assert len(task.inputs) == 2
                assert "gradient_update" in list(map(lambda x: x.func, task.inputs))
            elif task.func == "test":
                assert len(task.inputs) == 1
                assert len(task.outputs) == 0
            else:
>               assert False
E               assert False

tests/test_adpsgd.py:48: AssertionError
======================================================================================================================================================================== short test summary info =========================================================================================================================================================================
FAILED tests/test_adpsgd.py::test_adpsgd[20-10-0] - assert False
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
=========================================================================================================================================================================== 1 failed in 2.08s ============================================================================================================================================================================