Hi all, I am trying to use ktensorflow.TFJob wit a...
# ask-the-community
a
Hi all, I am trying to use ktensorflow.TFJob wit a custom image. However I'm not sure what exactly gets executed. So here is a rough outline of the code:
Copy code
@task(
    task_config=TfJob(
        chief=Chief(replicas=1, image=<some_image>),
        ps=PS(replicas=0, image=<some_image>),
        worker=Worker(replicas=1, image=<some_image>),
    ),
)
def func(some_arg: int):
    do somethign...
k
does the image <some_image> get run on each pod
yes, all the pods will use same image worker and master will run the same code https://www.tensorflow.org/guide/keras/distributed_training
you can pass an input from UI or use flytekit remote
or create a workflow, like @workflow def wf() x = create_output() training(x=x)
a
Thanks for your responses. so my current setup builds the image for workers/chief etc and then spawns a TFJob so that those images get executed and TF_CONFIG is set properly by flyte. This is one step of my workflow. The problem Im running into is that the image that is being run for chief/worker 's entrypoint expects cmdline args. How can I pass these in via the definition of the TFJob task?
Thanks in advance for any help
so Im using absl flags and seeing
Copy code
Unknown command line flag 'inputs'
which makes me think flyte is passing in some flags already
ok so I think what is happening is that flyte creates a container from this image and then runs pyflyte-execute.
So my image cant have an entrypoint thats an executable
k
yes, you can’t override the entrypoint
a
ok trying to figure out how to do this in my toolchain (bazel docker io)
k
what is absl? what do you want to run? download data?
a
absl is a command line parser
k
you want to use it in the pod running TF training?
a
yes
k
a
would this init container then run my custom image?
with args passed in
k
yes, you can use any image and args
a
can I alternatively not specify a custom image but make the TFJob decorate a container task
in the running container will TF_CONFIG be set?