Reputation
Badges 1
43 × Eureka!Okay so I discovered that setting -e CLEARML_AGENT_PACKAGE_PYTORCH_RESOLVE=none solves the issue.
That said, if someone could explain to me why this error was occurring and why it only happens in the case of cloning, I'd love to understand. Thanks!
Yes, that did make it work in this case, thank you.
Hi @<1523701205467926528:profile|AgitatedDove14> , I've actually hit on something accidentally that might be a clue. I have noticed that when running inside an agent, there is a bug wherein both Task.current_task() and Logger.current_logger() return None . If these are being used by the clearml package under the hood, this could be the reason we aren't seeing the metrics.
As a workaround, I created this utility function, which works for explicit logging (though it doesn't c...
Okay well I have to supply them again for the function to work, but the values are ignored so i can just have a hard-coded version for remote.
I am still struggling to figure out how to update the parameter defaults, though. I would like to be able to do the equivalent of the PipelineController.add_parameter() so that I can supply a local config with new defaults that are used on the remote execution. Otherwise, I’m stuck with whatever defaults are in the function signature.
Thanks very much! Yeah, it tends to fill up the console
Sure. I can send it on Monday. Thank you.
That could happen with any task when it’s cloned. To be honest, the cron and trigger schedulers probably deserve their own UI panel since they operate differently than other tasks. Ideally, a user would be able to add and remove jobs from the schedulers purely through the UI.
Hi @<1523701205467926528:profile|AgitatedDove14> , on the resource logging: I tried with a sleep test and it works when I'm running it from my local machine, but when I run remotely in an agent, i do not see resource logging.
And, similarly, with tensorboard logging, it works fine when running from my machine, but not when running remotely in an agent. For this, I've decided to just re-write the logging code to use ClearML's built-in logging methods, which work fine in the agent. Would stil...
The result i get in the agent is:
Traceback (most recent call last):
File "src/clearml_pipelines_examples/pipelines/examples/train_model_on_random_data/pipeline.py", line 89, in <module>
pipeline(**pipeline_ui_config)
TypeError: 'NoneType' object is not callable
Seems like the call to pipeline = PipelineDecorator.get_current_pipeline() returns None . Also, in the UI, I should be seeing all of the pipeline function parameters but I only see the config_file_path
Ahhh okay, thank you. Perhaps in the future, it would be great to allow this from the UI as well?
Sorry, i meant the arguments that are supplied to the decorator method, itself @PipelineDecorator.pipeline() and @PipelineDecorator.component() , things like name , project , docker_args , etc.
Here's my example script:
from random import randint
from clearml import Task
if __name__ == "__main__":
task: Task = Task.init(
project_name="clearml-examples", task_name="try-to-make-logging-work"
)
task.execute_remotely(queue_name="5da90f42dd4c40edab972a4bef8eab04")
logger = task.get_logger()
for i in range(10):
logger.report_scalar("example plot", series="random", value=randint(0, 100), iteration=i)
Ah interesting, okay. I'll try adding a sleep in here for testing it out. Thanks
Hi @<1523701205467926528:profile|AgitatedDove14> , CLEARML_TASK_ID is set inside the agent's process, which is how I was able to get the task by running Task.get_task(environ["CLEARML_TASK_ID") . However I believe I've sorted out how to make both the resource logging and the tensorboard logging work in the agent. It seems that using Task.current_task() to get the task object does not work when running remotely, but calling Task.init() again does work. And after having called ...
Okay, I take it back. os.getenv("CLEARML_TASK_ID") does work. I forgot to rebuild my container after making the change. Thanks for bringing this option to my attention!
Unfortunately, it's turning out to be quite time consuming to manually remove all of the private info in here. Is there a particular section of the log that would be useful to see? I can try to focus on just sharing that part.
Correction: it works when I am running the code in my local VSCode session. I still don't get resource logging when I run in an agent. 🤔 . And on a similar topic, I have a separate task that is logging metrics with tensorboard. When running locally, I see the metrics appear in the "scalars" tab in ClearML, but when running in an agent, nothing. Any suggestions on where to look?
@<1576381444509405184:profile|ManiacalLizard2> ,that’s interesting. So you actually need the imports to be in a certain order. That’s definitely new and a bit of an anti-pattern as it goes against recommended import statement order (built-in packages imported first) but if it works, that’s good news at least. I’ll try that as well. Thanks!
Are those fixed from the local environment or do i need to also supply those again in the remote context?
To be clear Task.init() was called initially. I had to call it again later in the code in order to get the current task object instead of Task.current_task() , which only seems to work locally. That's the part that is not intuitive.
It seems so, yes. I'm not the one who did the server migration, but as a user I believe this is when I started noticing the issue for new datasets created after the migration.
import json
import os
import sys
from argparse import ArgumentParser
from logging import getLogger
from pathlib import Path
from typing import Callable
from clearml import PipelineDecorator, Task
from clearml_pipelines_examples.base.pipeline_settings import ExecutionMode
from clearml_pipelines_examples.pipelines.examples.train_model_on_random_data import (
TrainModelPipelineKwargs,
TrainModelPipelineSettings,
)
from clearml_pipelines_examples.tasks.examples import generate_dat...
Server (see screenshot). Thanks!
Hi @<1523701070390366208:profile|CostlyOstrich36> , thanks for your reply. I’ll try both and see what happens.
Hi @<1523701205467926528:profile|AgitatedDove14> , thanks so the code to be executed by the task needs to be provided to the Task.create() method as script=some/path.py or does it work to have something like
def my_node_task_factory(node: PipelineController.Node) -> Task:
task = Task.create(...)
my_function()
return task
The bash setup script option doesn’t work because that runs before the repo is cloned. I could add the git clone step there, but not sure how to access the git credentials stored in the agent.
Gotcha. Are the parameters in @PipelineDecorator.pipeline() ignored in the remote context? Settings like the docker image and gitlab repo would already be used before the pipeline is kicked off on the agent.
The requirements option using git+https does work, at least for the main install_requires dependences in my setup.cfg. It didn’t install extra dependencies of i tried to do something like pip install my-package[with-optional] @ git+ None