ONE icon indicating copy to clipboard operation
ONE copied to clipboard

[onert/train] all of backend contexts are candidates when `TrainableExecutor` is created

Open YongseopKim opened this issue 2 years ago • 4 comments

When TrainableExecutor is created, all of backend contexts are candidates.

In ExecutorFactory::createTrainableExecutor,

https://github.com/Samsung/ONE/blob/890b72859b19af9c29488f88fc2e927a75f35c77/runtime/onert/core/src/compiler/ExecutorFactory.cc#L673-L681

The only candidate should be train backend context.

/cc @Samsung/one_onert

YongseopKim avatar Feb 15 '24 11:02 YongseopKim

I agree with you on this point. The TrainableExecutor must have a train backend context. However, I don't know it is enough to train the model using only the train backend context.

It seems necessary to restrict TrainableExecutor to include Train backend.

jyoungyun avatar Feb 19 '24 06:02 jyoungyun

Maybe for partial training? @ragmani

hseok-oh avatar Feb 20 '24 02:02 hseok-oh

(Anyway, my problem was resolved.)

YongseopKim avatar Feb 28 '24 05:02 YongseopKim

@YongseopKim

  • The TrainableExecutor have two backends (train backend and builtin backend) now, so TrainableBackendContexts is necessary even if the only candidate should be train backend.
  • All of backend contexts cannot be candidates, all of trainable backends(backend::train::ITrainableBackend) can be candidates.
  • There is also code to check non-trainable backends although it looks temporary code. https://github.com/Samsung/ONE/blob/7be192529936563e0910ae903f43a9eb97fc9214/runtime/onert/core/src/compiler/ExecutorFactory.cc#L726-L733

ragmani avatar Mar 05 '24 07:03 ragmani