Buckets:

download
raw
28.3 kB
import"../chunks/DsnmJJEf.js";import{i as ee,h as ae,C as se,H as m,D as r,E as re,s as ne,a as u}from"../chunks/D6eQvJIN.js";import{p as te,o as oe,s as e,f as p,a as c,b as le,c as n,d,n as o,r as t}from"../chunks/D9TCMYxZ.js";import{E as h}from"../chunks/D8azpo8f.js";const ie='{"title":"Utilities for Trainer","local":"utilities-for-trainer","sections":[{"title":"Utilities","local":"transformers.EvalPrediction","sections":[],"depth":2},{"title":"Callbacks internals","local":"transformers.trainer_callback.CallbackHandler","sections":[],"depth":2},{"title":"Trainer Argument Parser","local":"transformers.HfArgumentParser","sections":[],"depth":2},{"title":"Debug Utilities","local":"transformers.debug_utils.DebugUnderflowOverflow","sections":[],"depth":2}],"depth":1}';var ce=d('<meta name="hf:doc:metadata"/>'),de=d("<p>To activate the underflow/overflow detection, initialize the object with the model :</p> <!>",1),pe=d("<p>mixed precision :</p> <!>",1),me=d("<p>By default the last 21 frames are printed. You can change the default to adjust for your needs. For example :</p> <!>",1),ue=d("<p>given batch, and only do that for batches 1 and 3. Then you instantiate this class as :</p> <!>",1),he=d("<p>You can also specify the batch number after which to stop the training, with :</p> <!>",1),fe=d(`<p></p> <!> <!> <p>This page lists all the utility functions used by <a href="/docs/transformers/pr_36708/en/main_classes/trainer#transformers.Trainer">Trainer</a>.</p> <p>Most of those are only useful if you are studying the code of the Trainer in the library.</p> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Evaluation output (always contains labels), to be used to compute metrics.</p></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Helper function for reproducible behavior during distributed training. See <a href="https://pytorch.org/docs/stable/notes/randomness.html" rel="nofollow">https://pytorch.org/docs/stable/notes/randomness.html</a> for pytorch</p></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Helper function for reproducible behavior to set the seed in <code>random</code>, <code>numpy</code>, <code>torch</code> (if installed).</p></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Decorator to make all processes in distributed training wait for each local_master to do something.</p></div> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Internal class that just calls the list of callbacks in order.</p></div> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>This subclass of <code>argparse.ArgumentParser</code> uses type hints on dataclasses to generate arguments.</p> <p>The class is designed to play well with the native argparse. In particular, you can add more (non-dataclass backed)
arguments to the parser after initialization and you’ll get the output back after parsing as an additional
namespace. Optional: To create sub argument groups use the <code>_argument_group_name</code> attribute in the dataclass.</p> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Parse command-line args into instances of the specified dataclass types.</p> <p>This relies on argparse’s <code>ArgumentParser.parse_known_args</code>. See the doc at:
docs.python.org/3/library/argparse.html#argparse.ArgumentParser.parse_args</p></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Alternative helper method that does not use <code>argparse</code> at all, instead uses a dict and populating the dataclass
types.</p></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Alternative helper method that does not use <code>argparse</code> at all, instead loading a json file and populating the
dataclass types.</p></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Alternative helper method that does not use <code>argparse</code> at all, instead loading a yaml file and populating the
dataclass types.</p></div></div> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>This debug class helps detect and understand where the model starts getting very large or very small, and more
importantly <code>nan</code> or <code>inf</code> weight and activation elements.</p> <p>There are 2 working modes:</p> <ol><li>Underflow/overflow detection (default)</li> <li>Specific batch absolute min/max tracing without detection</li></ol> <p>Mode 1: Underflow/overflow detection</p> <!> <p>then run the training as normal and if <code>nan</code> or <code>inf</code> gets detected in at least one of the weight, input or output
elements this module will throw an exception and will print <code>max_frames_to_save</code> frames that lead to this event,
each frame reporting</p> <ol><li>the fully qualified module name plus the class name whose <code>forward</code> was run</li> <li>the absolute min and max value of all elements for each module weights, and the inputs and output</li></ol> <p>For example, here is the header and the last few frames in detection report for <code>google/mt5-small</code> run in fp16</p> <!> <p>You can see here, that <code>T5DenseGatedGeluDense.forward</code> resulted in output activations, whose absolute max value was
around 62.7K, which is very close to fp16’s top limit of 64K. In the next frame we have <code>Dropout</code> which
renormalizes the weights, after it zeroed some of the elements, which pushes the absolute max value to more than
64K, and we get an overflow.</p> <p>As you can see it’s the previous frames that we need to look into when the numbers start going into very large for
fp16 numbers.</p> <p>The tracking is done in a forward hook, which gets invoked immediately after <code>forward</code> has completed.</p> <!> <p>To validate that you have set up this debugging feature correctly, and you intend to use it in a training that
may take hours to complete, first run it with normal tracing enabled for one of a few batches as explained in
the next section.</p> <p>Mode 2. Specific batch absolute min/max tracing without detection</p> <p>The second work mode is per-batch tracing with the underflow/overflow detection feature turned off.</p> <p>Let’s say you want to watch the absolute min and max values for all the ingredients of each <code>forward</code> call of a</p> <!> <p>And now full batches 1 and 3 will be traced using the same format as explained above. Batches are 0-indexed.</p> <p>This is helpful if you know that the program starts misbehaving after a certain batch number, so you can
fast-forward right to that area.</p> <p>Early stopping:</p> <!> <p>This feature is mainly useful in the tracing mode, but you can use it for any mode.</p> <p><strong>Performance</strong>:</p> <p>As this module measures absolute <code>min</code>/\`<code>max</code> of each weight of the model on every forward it’ll slow the training
down. Therefore remember to turn it off once the debugging needs have been met.</p></div> <!> <p></p>`,1);function we(H,B){te(B,!1),oe(()=>{new URLSearchParams(window.location.search).get("fw")}),ee();var J=fe();ae("1g9hem2",s=>{var i=ce();ne(i,"content",ie),c(s,i)});var U=e(p(J),2);se(U,{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"});var A=e(U,2);m(A,{title:"Utilities for Trainer",local:"utilities-for-trainer",headingTag:"h1"});var I=e(A,6);m(I,{title:"Utilities",local:"transformers.EvalPrediction",headingTag:"h2"});var f=e(I,2),W=n(f);r(W,{name:"class transformers.EvalPrediction",anchor:"transformers.EvalPrediction",source:"https://github.com/huggingface/transformers/blob/vr_36708/src/transformers/trainer_utils.py#L210",parameters:[{name:"predictions",val:": numpy.ndarray | tuple[numpy.ndarray]"},{name:"label_ids",val:": numpy.ndarray | tuple[numpy.ndarray]"},{name:"inputs",val:": numpy.ndarray | tuple[numpy.ndarray] | None = None"},{name:"losses",val:": numpy.ndarray | tuple[numpy.ndarray] | None = None"}],parametersDescription:[{anchor:"transformers.EvalPrediction.predictions",description:"<strong>predictions</strong> (<code>np.ndarray</code>) &#x2014; Predictions of the model.",name:"predictions"},{anchor:"transformers.EvalPrediction.label_ids",description:"<strong>label_ids</strong> (<code>np.ndarray</code>) &#x2014; Targets to be matched.",name:"label_ids"},{anchor:"transformers.EvalPrediction.inputs",description:"<strong>inputs</strong> (<code>np.ndarray</code>, <em>optional</em>) &#x2014; Input data passed to the model.",name:"inputs"},{anchor:"transformers.EvalPrediction.losses",description:"<strong>losses</strong> (<code>np.ndarray</code>, <em>optional</em>) &#x2014; Loss values computed during evaluation.",name:"losses"}]}),o(2),t(f);var g=e(f,2),Q=n(g);r(Q,{name:"class transformers.IntervalStrategy",anchor:"transformers.IntervalStrategy",source:"https://github.com/huggingface/transformers/blob/vr_36708/src/transformers/trainer_utils.py#L389",parameters:[{name:"value",val:""},{name:"names",val:" = None"},{name:"module",val:" = None"},{name:"qualname",val:" = None"},{name:"type",val:" = None"},{name:"start",val:" = 1"},{name:"boundary",val:" = None"}]}),t(g);var b=e(g,2),F=n(b);r(F,{name:"transformers.enable_full_determinism",anchor:"transformers.enable_full_determinism",source:"https://github.com/huggingface/transformers/blob/vr_36708/src/transformers/trainer_utils.py#L154",parameters:[{name:"seed",val:": int"},{name:"warn_only",val:": bool = False"}]}),o(2),t(b);var _=e(b,2),R=n(_);r(R,{name:"transformers.set_seed",anchor:"transformers.set_seed",source:"https://github.com/huggingface/transformers/blob/vr_36708/src/transformers/trainer_utils.py#L180",parameters:[{name:"seed",val:": int"},{name:"deterministic",val:": bool = False"}],parametersDescription:[{anchor:"transformers.set_seed.seed",description:`<strong>seed</strong> (<code>int</code>) &#x2014;
The seed to set.`,name:"seed"},{anchor:"transformers.set_seed.deterministic",description:`<strong>deterministic</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use deterministic algorithms where available. Can slow down training.`,name:"deterministic"}]}),o(2),t(_);var v=e(_,2),z=n(v);r(z,{name:"transformers.torch_distributed_zero_first",anchor:"transformers.torch_distributed_zero_first",source:"https://github.com/huggingface/transformers/blob/vr_36708/src/transformers/trainer_pt_utils.py#L309",parameters:[{name:"local_rank",val:": int"}],parametersDescription:[{anchor:"transformers.torch_distributed_zero_first.local_rank",description:"<strong>local_rank</strong> (<code>int</code>) &#x2014; The rank of the local process.",name:"local_rank"}]}),o(2),t(v);var k=e(v,2);m(k,{title:"Callbacks internals",local:"transformers.trainer_callback.CallbackHandler",headingTag:"h2"});var w=e(k,2),Y=n(w);r(Y,{name:"class transformers.trainer_callback.CallbackHandler",anchor:"transformers.trainer_callback.CallbackHandler",source:"https://github.com/huggingface/transformers/blob/vr_36708/src/transformers/trainer_callback.py#L429",parameters:[{name:"callbacks",val:""},{name:"model",val:""},{name:"processing_class",val:""},{name:"optimizer",val:""},{name:"lr_scheduler",val:""}]}),o(2),t(w);var D=e(w,2);m(D,{title:"Trainer Argument Parser",local:"transformers.HfArgumentParser",headingTag:"h2"});var y=e(D,2),C=n(y);r(C,{name:"class transformers.HfArgumentParser",anchor:"transformers.HfArgumentParser",source:"https://github.com/huggingface/transformers/blob/vr_36708/src/transformers/hf_argparser.py#L111",parameters:[{name:"dataclass_types",val:": typing.Union[transformers.hf_argparser.DataClassType, collections.abc.Iterable[transformers.hf_argparser.DataClassType], NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.HfArgumentParser.dataclass_types",description:`<strong>dataclass_types</strong> (<code>DataClassType</code> or <code>Iterable[DataClassType]</code>, <em>optional</em>) &#x2014;
Dataclass type, or list of dataclass types for which we will &#x201C;fill&#x201D; instances with the parsed args.`,name:"dataclass_types"},{anchor:"transformers.HfArgumentParser.kwargs",description:`<strong>kwargs</strong> (<code>dict[str, Any]</code>, <em>optional</em>) &#x2014;
Passed to <code>argparse.ArgumentParser()</code> in the regular way.`,name:"kwargs"}]});var j=e(C,6),X=n(j);r(X,{name:"parse_args_into_dataclasses",anchor:"transformers.HfArgumentParser.parse_args_into_dataclasses",source:"https://github.com/huggingface/transformers/blob/vr_36708/src/transformers/hf_argparser.py#L272",parameters:[{name:"args",val:" = None"},{name:"return_remaining_strings",val:" = False"},{name:"look_for_args_file",val:" = True"},{name:"args_filename",val:" = None"},{name:"args_file_flag",val:" = None"}],parametersDescription:[{anchor:"transformers.HfArgumentParser.parse_args_into_dataclasses.args",description:`<strong>args</strong> &#x2014;
List of strings to parse. The default is taken from sys.argv. (same as argparse.ArgumentParser)`,name:"args"},{anchor:"transformers.HfArgumentParser.parse_args_into_dataclasses.return_remaining_strings",description:`<strong>return_remaining_strings</strong> &#x2014;
If true, also return a list of remaining argument strings.`,name:"return_remaining_strings"},{anchor:"transformers.HfArgumentParser.parse_args_into_dataclasses.look_for_args_file",description:`<strong>look_for_args_file</strong> &#x2014;
If true, will look for a &#x201C;.args&#x201D; file with the same base name as the entry point script for this
process, and will append its potential content to the command line args.`,name:"look_for_args_file"},{anchor:"transformers.HfArgumentParser.parse_args_into_dataclasses.args_filename",description:`<strong>args_filename</strong> &#x2014;
If not None, will uses this file instead of the &#x201C;.args&#x201D; file specified in the previous argument.`,name:"args_filename"},{anchor:"transformers.HfArgumentParser.parse_args_into_dataclasses.args_file_flag",description:`<strong>args_file_flag</strong> &#x2014;
If not None, will look for a file in the command-line args specified with this flag. The flag can be
specified multiple times and precedence is determined by the order (last one wins).`,name:"args_file_flag"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<ul>
<li>the dataclass instances in the same order as they were passed to the initializer.</li>
<li>if applicable, an additional namespace for more (non-dataclass backed) arguments added to the parser
after initialization.</li>
<li>The potential list of remaining argument strings. (same as argparse.ArgumentParser.parse_known_args)</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>
<p>Tuple consisting of</p>
`}),o(4),t(j);var M=e(j,2),S=n(M);r(S,{name:"parse_dict",anchor:"transformers.HfArgumentParser.parse_dict",source:"https://github.com/huggingface/transformers/blob/vr_36708/src/transformers/hf_argparser.py#L358",parameters:[{name:"args",val:": dict"},{name:"allow_extra_keys",val:": bool = False"}],parametersDescription:[{anchor:"transformers.HfArgumentParser.parse_dict.args",description:`<strong>args</strong> (<code>dict</code>) &#x2014;
dict containing config values`,name:"args"},{anchor:"transformers.HfArgumentParser.parse_dict.allow_extra_keys",description:`<strong>allow_extra_keys</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Defaults to False. If False, will raise an exception if the dict contains keys that are not parsed.`,name:"allow_extra_keys"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<ul>
<li>the dataclass instances in the same order as they were passed to the initializer.</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>
<p>Tuple consisting of</p>
`}),o(2),t(M);var T=e(M,2),O=n(T);r(O,{name:"parse_json_file",anchor:"transformers.HfArgumentParser.parse_json_file",source:"https://github.com/huggingface/transformers/blob/vr_36708/src/transformers/hf_argparser.py#L386",parameters:[{name:"json_file",val:": str | os.PathLike"},{name:"allow_extra_keys",val:": bool = False"}],parametersDescription:[{anchor:"transformers.HfArgumentParser.parse_json_file.json_file",description:`<strong>json_file</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
File name of the json file to parse`,name:"json_file"},{anchor:"transformers.HfArgumentParser.parse_json_file.allow_extra_keys",description:`<strong>allow_extra_keys</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Defaults to False. If False, will raise an exception if the json file contains keys that are not
parsed.`,name:"allow_extra_keys"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<ul>
<li>the dataclass instances in the same order as they were passed to the initializer.</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>
<p>Tuple consisting of</p>
`}),o(2),t(T);var Z=e(T,2),$=n(Z);r($,{name:"parse_yaml_file",anchor:"transformers.HfArgumentParser.parse_yaml_file",source:"https://github.com/huggingface/transformers/blob/vr_36708/src/transformers/hf_argparser.py#L408",parameters:[{name:"yaml_file",val:": str | os.PathLike"},{name:"allow_extra_keys",val:": bool = False"}],parametersDescription:[{anchor:"transformers.HfArgumentParser.parse_yaml_file.yaml_file",description:`<strong>yaml_file</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
File name of the yaml file to parse`,name:"yaml_file"},{anchor:"transformers.HfArgumentParser.parse_yaml_file.allow_extra_keys",description:`<strong>allow_extra_keys</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Defaults to False. If False, will raise an exception if the json file contains keys that are not
parsed.`,name:"allow_extra_keys"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<ul>
<li>the dataclass instances in the same order as they were passed to the initializer.</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>
<p>Tuple consisting of</p>
`}),o(2),t(Z),t(y);var G=e(y,2);m(G,{title:"Debug Utilities",local:"transformers.debug_utils.DebugUnderflowOverflow",headingTag:"h2"});var x=e(G,2),P=n(x);r(P,{name:"class transformers.debug_utils.DebugUnderflowOverflow",anchor:"transformers.debug_utils.DebugUnderflowOverflow",source:"https://github.com/huggingface/transformers/blob/vr_36708/src/transformers/debug_utils.py#L27",parameters:[{name:"model",val:""},{name:"max_frames_to_save",val:" = 21"},{name:"trace_batch_nums",val:" = None"},{name:"abort_after_batch_num",val:" = None"}],parametersDescription:[{anchor:"transformers.debug_utils.DebugUnderflowOverflow.model",description:`<strong>model</strong> (<code>nn.Module</code>) &#x2014;
The model to debug.`,name:"model"},{anchor:"transformers.debug_utils.DebugUnderflowOverflow.max_frames_to_save",description:`<strong>max_frames_to_save</strong> (<code>int</code>, <em>optional</em>, defaults to 21) &#x2014;
How many frames back to record`,name:"max_frames_to_save"},{anchor:"transformers.debug_utils.DebugUnderflowOverflow.trace_batch_nums(list[int],",description:`<strong>trace_batch_nums(<code>list[int]</code>,</strong> <em>optional</em>, defaults to <code>[]</code>) &#x2014;
Which batch numbers to trace (turns detection off)`,name:"trace_batch_nums(list[int],"},{anchor:"transformers.debug_utils.DebugUnderflowOverflow.abort_after_batch_num",description:"<strong>abort_after_batch_num</strong> (`int&#x201C;, <em>optional</em>) &#x2014;\nWhether to abort after a certain batch number has finished",name:"abort_after_batch_num"}]});var V=e(P,10);h(V,{anchor:"transformers.debug_utils.DebugUnderflowOverflow.example",children:(s,i)=>{var a=de(),l=e(p(a),2);u(l,{code:"ZGVidWdfb3ZlcmZsb3clMjAlM0QlMjBEZWJ1Z1VuZGVyZmxvd092ZXJmbG93KG1vZGVsKQ==",highlighted:"debug_overflow = DebugUnderflowOverflow(model)",lang:"python",wrap:!1}),c(s,a)},$$slots:{default:!0}});var E=e(V,8);h(E,{anchor:"transformers.debug_utils.DebugUnderflowOverflow.example-2",children:(s,i)=>{var a=pe(),l=e(p(a),2);u(l,{code:"RGV0ZWN0ZWQlMjBpbmYlMkZuYW4lMjBkdXJpbmclMjBiYXRjaF9udW1iZXIlM0QwJTBBTGFzdCUyMDIxJTIwZm9yd2FyZCUyMGZyYW1lcyUzQSUwQWFicyUyMG1pbiUyMCUyMGFicyUyMG1heCUyMCUyMG1ldGFkYXRhJTBBJTVCLi4uJTVEJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwZW5jb2Rlci5ibG9jay4yLmxheWVyLjEuRGVuc2VSZWx1RGVuc2Uud2lfMCUyMExpbmVhciUwQTIuMTdlLTA3JTIwNC41MGUlMkIwMCUyMHdlaWdodCUwQTEuNzllLTA2JTIwNC42NWUlMkIwMCUyMGlucHV0JTVCMCU1RCUwQTIuNjhlLTA2JTIwMy43MGUlMkIwMSUyMG91dHB1dCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGVuY29kZXIuYmxvY2suMi5sYXllci4xLkRlbnNlUmVsdURlbnNlLndpXzElMjBMaW5lYXIlMEE4LjA4ZS0wNyUyMDIuNjZlJTJCMDElMjB3ZWlnaHQlMEExLjc5ZS0wNiUyMDQuNjVlJTJCMDAlMjBpbnB1dCU1QjAlNUQlMEExLjI3ZS0wNCUyMDIuMzdlJTJCMDIlMjBvdXRwdXQlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBlbmNvZGVyLmJsb2NrLjIubGF5ZXIuMS5EZW5zZVJlbHVEZW5zZS53byUyMExpbmVhciUwQTEuMDFlLTA2JTIwNi40NGUlMkIwMCUyMHdlaWdodCUwQTAuMDBlJTJCMDAlMjA5Ljc0ZSUyQjAzJTIwaW5wdXQlNUIwJTVEJTBBMy4xOGUtMDQlMjA2LjI3ZSUyQjA0JTIwb3V0cHV0JTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwZW5jb2Rlci5ibG9jay4yLmxheWVyLjEuRGVuc2VSZWx1RGVuc2UlMjBUNURlbnNlR2F0ZWRHZWx1RGVuc2UlMEExLjc5ZS0wNiUyMDQuNjVlJTJCMDAlMjBpbnB1dCU1QjAlNUQlMEEzLjE4ZS0wNCUyMDYuMjdlJTJCMDQlMjBvdXRwdXQlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBlbmNvZGVyLmJsb2NrLjIubGF5ZXIuMS5kcm9wb3V0JTIwRHJvcG91dCUwQTMuMThlLTA0JTIwNi4yN2UlMkIwNCUyMGlucHV0JTVCMCU1RCUwQTAuMDBlJTJCMDAlMjAlMjAlMjAlMjAlMjAlMjBpbmYlMjBvdXRwdXQ=",highlighted:`<span class="hljs-attribute">Detected</span> inf/nan during batch_number=<span class="hljs-number">0</span>
<span class="hljs-attribute">Last</span> <span class="hljs-number">21</span> forward frames:
<span class="hljs-attribute">abs</span> min abs max metadata<span class="hljs-meta">
[...]</span>
<span class="hljs-attribute">encoder</span>.block.<span class="hljs-number">2</span>.layer.<span class="hljs-number">1</span>.DenseReluDense.wi_0 Linear
<span class="hljs-attribute">2</span>.<span class="hljs-number">17</span>e-<span class="hljs-number">07</span> <span class="hljs-number">4</span>.<span class="hljs-number">50</span>e+<span class="hljs-number">00</span> weight
<span class="hljs-attribute">1</span>.<span class="hljs-number">79</span>e-<span class="hljs-number">06</span> <span class="hljs-number">4</span>.<span class="hljs-number">65</span>e+<span class="hljs-number">00</span> input[<span class="hljs-number">0</span>]
<span class="hljs-attribute">2</span>.<span class="hljs-number">68</span>e-<span class="hljs-number">06</span> <span class="hljs-number">3</span>.<span class="hljs-number">70</span>e+<span class="hljs-number">01</span> output
<span class="hljs-attribute">encoder</span>.block.<span class="hljs-number">2</span>.layer.<span class="hljs-number">1</span>.DenseReluDense.wi_1 Linear
<span class="hljs-attribute">8</span>.<span class="hljs-number">08</span>e-<span class="hljs-number">07</span> <span class="hljs-number">2</span>.<span class="hljs-number">66</span>e+<span class="hljs-number">01</span> weight
<span class="hljs-attribute">1</span>.<span class="hljs-number">79</span>e-<span class="hljs-number">06</span> <span class="hljs-number">4</span>.<span class="hljs-number">65</span>e+<span class="hljs-number">00</span> input[<span class="hljs-number">0</span>]
<span class="hljs-attribute">1</span>.<span class="hljs-number">27</span>e-<span class="hljs-number">04</span> <span class="hljs-number">2</span>.<span class="hljs-number">37</span>e+<span class="hljs-number">02</span> output
<span class="hljs-attribute">encoder</span>.block.<span class="hljs-number">2</span>.layer.<span class="hljs-number">1</span>.DenseReluDense.wo Linear
<span class="hljs-attribute">1</span>.<span class="hljs-number">01</span>e-<span class="hljs-number">06</span> <span class="hljs-number">6</span>.<span class="hljs-number">44</span>e+<span class="hljs-number">00</span> weight
<span class="hljs-attribute">0</span>.<span class="hljs-number">00</span>e+<span class="hljs-number">00</span> <span class="hljs-number">9</span>.<span class="hljs-number">74</span>e+<span class="hljs-number">03</span> input[<span class="hljs-number">0</span>]
<span class="hljs-attribute">3</span>.<span class="hljs-number">18</span>e-<span class="hljs-number">04</span> <span class="hljs-number">6</span>.<span class="hljs-number">27</span>e+<span class="hljs-number">04</span> output
<span class="hljs-attribute">encoder</span>.block.<span class="hljs-number">2</span>.layer.<span class="hljs-number">1</span>.DenseReluDense T5DenseGatedGeluDense
<span class="hljs-attribute">1</span>.<span class="hljs-number">79</span>e-<span class="hljs-number">06</span> <span class="hljs-number">4</span>.<span class="hljs-number">65</span>e+<span class="hljs-number">00</span> input[<span class="hljs-number">0</span>]
<span class="hljs-attribute">3</span>.<span class="hljs-number">18</span>e-<span class="hljs-number">04</span> <span class="hljs-number">6</span>.<span class="hljs-number">27</span>e+<span class="hljs-number">04</span> output
<span class="hljs-attribute">encoder</span>.block.<span class="hljs-number">2</span>.layer.<span class="hljs-number">1</span>.dropout Dropout
<span class="hljs-attribute">3</span>.<span class="hljs-number">18</span>e-<span class="hljs-number">04</span> <span class="hljs-number">6</span>.<span class="hljs-number">27</span>e+<span class="hljs-number">04</span> input[<span class="hljs-number">0</span>]
<span class="hljs-attribute">0</span>.<span class="hljs-number">00</span>e+<span class="hljs-number">00</span> inf output`,lang:"",wrap:!1}),c(s,a)},$$slots:{default:!0}});var N=e(E,8);h(N,{anchor:"transformers.debug_utils.DebugUnderflowOverflow.example-3",children:(s,i)=>{var a=me(),l=e(p(a),2);u(l,{code:"ZGVidWdfb3ZlcmZsb3clMjAlM0QlMjBEZWJ1Z1VuZGVyZmxvd092ZXJmbG93KG1vZGVsJTJDJTIwbWF4X2ZyYW1lc190b19zYXZlJTNEMTAwKQ==",highlighted:'debug_overflow = DebugUnderflowOverflow(model, max_frames_to_save=<span class="hljs-number">100</span>)',lang:"python",wrap:!1}),c(s,a)},$$slots:{default:!0}});var L=e(N,10);h(L,{anchor:"transformers.debug_utils.DebugUnderflowOverflow.example-4",children:(s,i)=>{var a=ue(),l=e(p(a),2);u(l,{code:"ZGVidWdfb3ZlcmZsb3clMjAlM0QlMjBEZWJ1Z1VuZGVyZmxvd092ZXJmbG93KG1vZGVsJTJDJTIwdHJhY2VfYmF0Y2hfbnVtcyUzRCU1QjElMkMlMjAzJTVEKQ==",highlighted:'debug_overflow = DebugUnderflowOverflow(model, trace_batch_nums=[<span class="hljs-number">1</span>, <span class="hljs-number">3</span>])',lang:"python",wrap:!1}),c(s,a)},$$slots:{default:!0}});var K=e(L,8);h(K,{anchor:"transformers.debug_utils.DebugUnderflowOverflow.example-5",children:(s,i)=>{var a=he(),l=e(p(a),2);u(l,{code:"ZGVidWdfb3ZlcmZsb3clMjAlM0QlMjBEZWJ1Z1VuZGVyZmxvd092ZXJmbG93KG1vZGVsJTJDJTIwdHJhY2VfYmF0Y2hfbnVtcyUzRCU1QjElMkMlMjAzJTVEJTJDJTIwYWJvcnRfYWZ0ZXJfYmF0Y2hfbnVtJTNEMyk=",highlighted:'debug_overflow = DebugUnderflowOverflow(model, trace_batch_nums=[<span class="hljs-number">1</span>, <span class="hljs-number">3</span>], abort_after_batch_num=<span class="hljs-number">3</span>)',lang:"python",wrap:!1}),c(s,a)},$$slots:{default:!0}}),o(6),t(x);var q=e(x,2);re(q,{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/internal/trainer_utils.md"}),o(2),c(H,J),le()}export{we as component};

Xet Storage Details

Size:
28.3 kB
·
Xet hash:
62af612c43c06d844552e98c0cd51b4cee6122c7b0b7d18bc6eb1cfb01ced189

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.