tensorflow / tensorflow/java

Interaction between Tensorflow Java and JavaCPP Pointer deallocation

Open
#208 40 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
928
Forks
227
PR merge metrics
No merged PRs in 30d

Description

I am trying to understand why when I use DJL + Tensorflow engine, there is a good amount of time spent in GC, while both DJL and Tensorflow Java seem to use pointerscope and do not relay on GC for object cleanup.

For example, I see JavaCPP Pointer.deallocator gets invoked https://github.com/bytedeco/javacpp/blob/master/src/main/java/org/bytedeco/javacpp/Pointer.java#L666-L667

which is a heavy synchronized call.

Any help is appreciated.

Screen Shot 2021-02-04 at 4 34 24 PM

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the linked Pointer.java deallocator implementation first, then trace how DJL and the TensorFlow engine use PointerScope during the reported workload. Reproduce the GC profile and compare deallocator activity; done means documenting the cause of the synchronized cleanup cost and a validated direction for reducing it.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, tensorflow
Domain
machine-learning, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.