Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Lorsque Vertex AI Pipelines exécute un pipeline, il vérifie si une exécution existe dans Vertex ML Metadata avec l'interface (clé du cache) de chaque étape du pipeline.
L'interface de l'étape correspond à la combinaison des éléments suivants :
Les entrées de l'étape du pipeline. Ces entrées incluent la valeur des paramètres d'entrée (le cas échéant) et l'ID de l'artefact d'entrée (le cas échéant).
La définition de sortie de l'étape de pipeline. Cette définition de sortie inclut une définition du paramètre de sortie (le nom, le cas échéant) et une définition de l'artefact de sortie (le nom, le cas échéant).
La spécification du composant. Cette spécification inclut l'image, les commandes, les arguments et les variables d'environnement utilisés, ainsi que l'ordre des commandes et des arguments.
De plus, seuls les pipelines portant le même nom de pipeline partagent le cache.
S'il existe une exécution correspondante dans Vertex ML Metadata, les résultats de cette exécution sont utilisés et l'étape est ignorée. Cela permet de réduire les coûts en ignorant les calculs effectués lors d'une exécution précédente du pipeline.
Vous pouvez désactiver la mise en cache d'exécution au niveau des tâches en définissant les éléments suivants :
eval_task.set_caching_options(False)
Vous pouvez désactiver la mise en cache d'exécution pour l'intégralité d'un job de pipeline. Lorsque vous exécutez un pipeline à l'aide de PipelineJob(), vous pouvez utiliser l'argument enable_caching pour indiquer que cette exécution de pipeline n'utilise pas la mise en cache. Toutes les étapes au sein du job de pipeline n'utilisent pas la mise en cache.
Découvrez comment créer des exécutions de pipeline.
Utilisez l'exemple suivant pour désactiver la mise en cache :
pl=PipelineJob(display_name="Myfirstpipeline",# Whether or not to enable caching# True = enable the current run to use caching results from previous runs# False = disable the current run's use of caching results from previous runs# None = defer to cache option for each pipeline component in the pipeline definitionenable_caching=False,# Local or Cloud Storage path to a compiled pipeline definitiontemplate_path="pipeline.yaml",# Dictionary containing input parameters for your pipelineparameter_values=parameter_values,# Cloud Storage path to act as the pipeline rootpipeline_root=pipeline_root,)
Les limites suivantes s'appliquent à cette fonctionnalité :
Le résultat mis en cache n'a pas de valeur TTL (Time To Live) et peut être réutilisé tant que l'entrée n'est pas supprimée de Vertex ML Metadata. Si l'entrée est supprimée de Vertex ML Metadata, la tâche est réexécutée pour générer à nouveau le résultat.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2024/11/22 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2024/11/22 (UTC)."],[],[],null,["# Configure execution caching\n\nWhen Vertex AI Pipelines runs a pipeline, it checks to see whether or not\nan *execution* exists in Vertex ML Metadata with the interface\n(cache key) of each pipeline step.\n\nThe step's interface is defined as the combination of the following:\n\n1. The **pipeline step's inputs**. These inputs include the input\n parameters' value (if any) and the input artifact ID (if any).\n\n2. The **pipeline step's output definition**. This output definition\n includes output parameter definition (name, if any) and output artifact\n definition (name, if any).\n\n3. The **component's specification**. This specification includes the\n image, commands, arguments and environment variables being used, as well\n as the order of the\n commands and arguments.\n\nAdditionally, only the pipelines with the same pipeline name will share the\ncache.\n\nIf there is a matching execution in Vertex ML Metadata, the outputs of\nthat execution are used and the step is skipped. This helps to reduce costs by\nskipping computations that were completed in a previous pipeline run.\n\nYou can turn off execution caching at task level by setting the following: \n\n eval_task.set_caching_options(False)\n\nYou can turn off execution caching for an entire pipeline job. When you run\na pipeline using `PipelineJob()`, you can use the `enable_caching` argument to\nspecify that this pipeline run does not use caching. All steps within the\npipeline job won't use caching.\n[Learn more about creating pipeline runs](/vertex-ai/docs/pipelines/run-pipeline).\n\nUse the following sample to turn off caching: \n\n pl = PipelineJob(\n display_name=\"My first pipeline\",\n\n # Whether or not to enable caching\n # True = enable the current run to use caching results from previous runs\n # False = disable the current run's use of caching results from previous runs\n # None = defer to cache option for each pipeline component in the pipeline definition\n enable_caching=False,\n\n # Local or Cloud Storage path to a compiled pipeline definition\n template_path=\"pipeline.yaml\",\n\n # Dictionary containing input parameters for your pipeline\n parameter_values=parameter_values,\n\n # Cloud Storage path to act as the pipeline root\n pipeline_root=pipeline_root,\n )\n\n| **Important:** Pipeline components should be built to be deterministic. A given set of inputs should always produce the same output. Depending on their interface, non-deterministic pipeline components can be unexpectedly skipped due to execution caching.\n\nThe following limitations apply to this feature:\n\n- The cached result doesn't have a time to live (TTL), and can be reused as long as the entry is not deleted from the Vertex ML Metadata. If the entry is deleted from Vertex ML Metadata, the task will rerun to regenerate the result again."]]