Skip to content

Commit e5c512f

Browse files
authored
Fix integration test in 24.10 (#8480)
Fixes #8479 ### Description A few sentences describing the changes proposed in this pull request. ### Types of changes <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Non-breaking change (fix or new feature that would not break existing functionality). - [ ] Breaking change (fix or new feature that would cause existing functionality to change). - [ ] New tests added to cover the changes. - [ ] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [ ] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [ ] In-line docstrings updated. - [ ] Documentation updated, tested `make html` command in the `docs/` folder. --------- Signed-off-by: YunLiu <55491388+KumoLiu@users.noreply.github.com>
1 parent 423ea74 commit e5c512f

File tree

3 files changed

+100
-61
lines changed

3 files changed

+100
-61
lines changed

tests/integration/test_integration_classification_2d.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ def train_and_infer(self, idx=0):
256256
# check training properties
257257
self.assertTrue(test_integration_value(TASK, key="losses", data=losses, rtol=1e-2))
258258
self.assertTrue(test_integration_value(TASK, key="best_metric", data=best_metric, rtol=1e-4))
259-
np.testing.assert_allclose(best_metric_epoch, 4)
259+
np.testing.assert_allclose(best_metric_epoch, 1)
260260
model_file = os.path.join(self.data_dir, "best_metric_model.pth")
261261
self.assertTrue(os.path.exists(model_file))
262262
# check inference properties
@@ -268,7 +268,7 @@ def train_and_infer(self, idx=0):
268268

269269
def test_training(self):
270270
repeated = []
271-
for i in range(1):
271+
for i in range(2):
272272
results = self.train_and_infer(i)
273273
repeated.append(results)
274274
np.testing.assert_allclose(repeated[0], repeated[1])

tests/integration/test_integration_workflows_adversarial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def tearDown(self):
158158
set_determinism(seed=None)
159159
shutil.rmtree(self.data_dir)
160160

161-
@TimedCall(seconds=200, daemon=False)
161+
@TimedCall(seconds=300, daemon=False)
162162
def test_training(self):
163163
torch.manual_seed(0)
164164

tests/testing_data/integration_answers.py

Lines changed: 97 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -70,64 +70,6 @@
7070
],
7171
}
7272
},
73-
{ # test answers for PyTorch 1.13
74-
"integration_workflows": {
75-
"output_sums_2": [
76-
0.14264830205979873,
77-
0.15264129328718357,
78-
0.1519652511118344,
79-
0.14003114557361543,
80-
0.18870416611118465,
81-
0.1699260498246968,
82-
0.14727475398203582,
83-
0.16870874483246967,
84-
0.15757932277023196,
85-
0.1797779694564011,
86-
0.16310501082450635,
87-
0.16850569170136015,
88-
0.14472958359864832,
89-
0.11402527744419455,
90-
0.16217657428257873,
91-
0.20135486560244975,
92-
0.17627557567092866,
93-
0.09802074024435596,
94-
0.19418729084978026,
95-
0.20339278025379662,
96-
0.1966174446916041,
97-
0.20872528599049203,
98-
0.16246183433492764,
99-
0.1323750751202327,
100-
0.14830347036335728,
101-
0.14300732028781024,
102-
0.23163101813922762,
103-
0.1612925258625139,
104-
0.1489573676973957,
105-
0.10299491921717041,
106-
0.11921404797064328,
107-
0.1300212751422368,
108-
0.11437829790254125,
109-
0.1524755276727056,
110-
0.16350584736767904,
111-
0.19424317961257148,
112-
0.2229762916892286,
113-
0.18121074825540173,
114-
0.19064286213535897,
115-
0.0747544243069024,
116-
]
117-
},
118-
"integration_segmentation_3d": { # for the mixed readers
119-
"losses": [
120-
0.5451162219047546,
121-
0.4709601759910583,
122-
0.45201429128646853,
123-
0.4443251401185989,
124-
0.4341257899999619,
125-
0.4350819975137711,
126-
],
127-
"best_metric": 0.9316844940185547,
128-
"infer_metric": 0.9316383600234985,
129-
},
130-
},
13173
{ # test answers for cuda 12
13274
"integration_segmentation_3d": {
13375
"losses": [
@@ -296,6 +238,103 @@
296238
],
297239
}
298240
},
241+
{ # test answers for 24.10
242+
"integration_classification_2d": {
243+
"losses": 0.7806512035761669,
244+
"best_metric": 0.9977695200407783,
245+
"infer_prop": [805, 727, 955, 1033, 321, 993],
246+
},
247+
"integration_workflows": {
248+
"best_metric": 0.9207136034965515,
249+
"best_metric_2": 0.9216295480728149,
250+
"infer_metric": 0.920440673828125,
251+
"infer_metric_2": 0.9203161001205444,
252+
"output_sums": [
253+
0.1423349380493164,
254+
0.15172767639160156,
255+
0.1382155418395996,
256+
0.13398218154907227,
257+
0.18552064895629883,
258+
0.16435527801513672,
259+
0.14128494262695312,
260+
0.16725540161132812,
261+
0.15690851211547852,
262+
0.17731285095214844,
263+
0.16189050674438477,
264+
0.16543960571289062,
265+
0.14431238174438477,
266+
0.11064529418945312,
267+
0.16129302978515625,
268+
0.1970067024230957,
269+
0.17503118515014648,
270+
0.053476810455322266,
271+
0.1914362907409668,
272+
0.2001795768737793,
273+
0.19636154174804688,
274+
0.2040243148803711,
275+
0.1606454849243164,
276+
0.13213014602661133,
277+
0.15132904052734375,
278+
0.1370987892150879,
279+
0.22805070877075195,
280+
0.16170072555541992,
281+
0.1477980613708496,
282+
0.10428047180175781,
283+
0.1195521354675293,
284+
0.13089942932128906,
285+
0.11238527297973633,
286+
0.15204906463623047,
287+
0.1603565216064453,
288+
0.19054937362670898,
289+
0.21789216995239258,
290+
0.17824840545654297,
291+
0.18654584884643555,
292+
0.03622245788574219,
293+
],
294+
"output_sums_2": [
295+
0.1423349380493164,
296+
0.15172767639160156,
297+
0.1382155418395996,
298+
0.13398218154907227,
299+
0.18552064895629883,
300+
0.16435527801513672,
301+
0.14128494262695312,
302+
0.16725540161132812,
303+
0.15690851211547852,
304+
0.17731285095214844,
305+
0.16189050674438477,
306+
0.16543960571289062,
307+
0.14431238174438477,
308+
0.11064529418945312,
309+
0.16129302978515625,
310+
0.1970067024230957,
311+
0.17503118515014648,
312+
0.053476810455322266,
313+
0.1914362907409668,
314+
0.2001795768737793,
315+
0.19636154174804688,
316+
0.2040243148803711,
317+
0.1606454849243164,
318+
0.13213014602661133,
319+
0.15132904052734375,
320+
0.1370987892150879,
321+
0.22805070877075195,
322+
0.16170072555541992,
323+
0.1477980613708496,
324+
0.10428047180175781,
325+
0.1195521354675293,
326+
0.13089942932128906,
327+
0.11238527297973633,
328+
0.15204906463623047,
329+
0.1603565216064453,
330+
0.19054937362670898,
331+
0.21789216995239258,
332+
0.17824840545654297,
333+
0.18654584884643555,
334+
0.03622245788574219,
335+
],
336+
},
337+
},
299338
]
300339

301340

0 commit comments

Comments
 (0)