tensorflow / tensorflow/model-optimization
Performance issue in the program
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.6k
- Forks
- 349
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 1
Description
Hello, I found a performance issue in the definition of encode, tensorflow_model_optimization/python/core/internal/tensor_encoding/stages/research/kashin.py, tf.cast will be calculated repeatedly during program execution, resulting in reduced efficiency. I think it should be created before the loop in encode.
Looking forward to your reply. Btw, I am very glad to create a PR to fix it if you are too busy.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in tensorflow_model_optimization/python/core/internal/tensor_encoding/stages/research/kashin.py at the encode definition and inspect the tf.cast call around line 201 and its surrounding loop. Confirm how often the cast is evaluated, then verify the change with the relevant existing tests or execution path. Done means the cast is created before the loop without changing encode's behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, tensorflow
- Domain
- machine-learning, performance
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100