nncf icon indicating copy to clipboard operation
nncf copied to clipboard

[Good First Issue][NNCF]: dump the ignored scope more gracefully

Open ljaljushkin opened this issue 1 year ago • 4 comments

Context

NNCF saves parameters of the compression to OpenVINO IR. It's done in dump_parameters method using set_rt_info API. But the problem is that ignored scope is saved not gracefully - it prints all fields even if they are empty. image

What needs to be done?

  1. Dump ignored scope in more compact way.
  • not dump <validate value="True" />
  • not dump fields names, patterns or types when they are empty. image
  • when all fields empty - dump in one line: <ignored_scope value=[]> image
  1. Add very lightweight unit test checking the content of <rt_info> for a dummy synthetic model, for example via get_rt_info API.

Example Pull Requests

No response

Resources

Contact points

@ljaljushkin

Ticket

129593

ljaljushkin avatar Mar 08 '24 13:03 ljaljushkin

.take

Viditagarwal7479 avatar Mar 11 '24 09:03 Viditagarwal7479

Thank you for looking into this issue! Please let us know if you have any questions or require any help.

github-actions[bot] avatar Mar 11 '24 09:03 github-actions[bot]

Hello @ljaljushkin and @alexsu52 ,

I have corrected it to,

  • not dump <validate value="True" />
  • not dump names, patterns or types when they are empty.

In the case when,

when all fields empty

The dump is looking like <ignored_scope value="None" /> is this fine? If not then is there any other way other than modifying the C++ code of set_rt_info API?

Viditagarwal7479 avatar Mar 13 '24 18:03 Viditagarwal7479

Hello, never mind, I figured it out! Now it's dumping <ignored_scope value="[]" /> when all fields are empty ^^ Will create a PR soon after adding unit tests.

Viditagarwal7479 avatar Mar 14 '24 18:03 Viditagarwal7479