ECP-CANDLE / Benchmarks

ECP-CANDLE Benchmarks
MIT License
59 stars 83 forks source link

Error in P3B7 prune.py: fix for error from pruning function remove() on line 237 in prune.py #100

Closed vgutta closed 3 years ago

vgutta commented 3 years ago

While running p3b7_baseline.py I'm getting the following error

Traceback (most recent call last):
  File "p3b7_baseline.py", line 206, in <module>
    main()
  File "p3b7_baseline.py", line 202, in main
    run(params)
  File "p3b7_baseline.py", line 197, in run
    model = remove_prune_masks(model)
  File "/p/project/scalasca/candle/Benchmarks/Pilot3/P3B7/prune.py", line 237, in remove_prune_masks
    prune.remove(module, name='weight', amount=0.2)
TypeError: remove() got an unexpected keyword argument 'amount'

After looking at the documentation for that function, I switched remove() to random_unstructured() and did not get that error.

So wanted to recommend this fix

gounley commented 3 years ago

Hey @vgutta , thanks pointing out the bug and posting this PR. I just pushed an alternate fix in this commit, as I think the (necessary) step you are mention is already being performed in this line.

Would you mind testing if this fix works for you?

vgutta commented 3 years ago

@gounley Yes, it works!