blob: cdff9a959e3221b0bc5df9b580a8e48b46b08036 [file] [log] [blame]
(window.webpackJsonp=window.webpackJsonp||[]).push([[23],{144:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return d}));var n=r(0),a=r.n(n);function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function s(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var l=a.a.createContext({}),b=function(e){var t=a.a.useContext(l),r=t;return e&&(r="function"==typeof e?e(t):u(u({},t),e)),r},o=function(e){var t=b(e.components);return a.a.createElement(l.Provider,{value:t},e.children)},m={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},p=a.a.forwardRef((function(e,t){var r=e.components,n=e.mdxType,i=e.originalType,c=e.parentName,l=s(e,["components","mdxType","originalType","parentName"]),o=b(r),p=n,d=o["".concat(c,".").concat(p)]||o[p]||m[p]||i;return r?a.a.createElement(d,u(u({ref:t},l),{},{components:r})):a.a.createElement(d,u({ref:t},l))}));function d(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var i=r.length,c=new Array(i);c[0]=p;var u={};for(var s in t)hasOwnProperty.call(t,s)&&(u[s]=t[s]);u.originalType=e,u.mdxType="string"==typeof e?e:n,c[1]=u;for(var l=2;l<i;l++)c[l]=r[l];return a.a.createElement.apply(null,c)}return a.a.createElement.apply(null,r)}p.displayName="MDXCreateElement"},90:function(e,t,r){"use strict";r.r(t),r.d(t,"frontMatter",(function(){return c})),r.d(t,"metadata",(function(){return u})),r.d(t,"toc",(function(){return s})),r.d(t,"default",(function(){return b}));var n=r(3),a=r(7),i=(r(0),r(144)),c={title:"PySubmarine Tracking"},u={unversionedId:"userDocs/submarine-sdk/pysubmarine/tracking",id:"userDocs/submarine-sdk/pysubmarine/tracking",isDocsHomePage:!1,title:"PySubmarine Tracking",description:"\x3c!---",source:"@site/docs/userDocs/submarine-sdk/pysubmarine/tracking.md",slug:"/userDocs/submarine-sdk/pysubmarine/tracking",permalink:"/docs/userDocs/submarine-sdk/pysubmarine/tracking",editUrl:"https://github.com/apache/submarine/edit/master/website/docs/userDocs/submarine-sdk/pysubmarine/tracking.md",version:"current"},s=[{value:"Quickstart",id:"quickstart",children:[]},{value:"Functions",id:"functions",children:[{value:"<code>submarine.get_tracking_uri()</code>",id:"submarineget_tracking_uri",children:[]},{value:"<code>submarine.set_tracking_uri(URI)</code>",id:"submarineset_tracking_uriuri",children:[]},{value:"<code>submarine.log_metric(key, value, step=0)</code>",id:"submarinelog_metrickey-value-step0",children:[]},{value:"<code>submarine.log_param(key, value)</code>",id:"submarinelog_paramkey-value",children:[]}]}],l={toc:s};function b(e){var t=e.components,r=Object(a.a)(e,["components"]);return Object(i.b)("wrapper",Object(n.a)({},l,r,{components:t,mdxType:"MDXLayout"}),Object(i.b)("p",null,"It helps developers use submarine's internal data caching,\ndata exchange, and task tracking capabilities to more efficiently improve the\ndevelopment and execution of machine learning productivity"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"Allow data scientist to track distributed ML experiemnt"),Object(i.b)("li",{parentName:"ul"},"Support store ML parameters and metrics in Submarine-server"),Object(i.b)("li",{parentName:"ul"},"Support hdfs, S3 and mysql (Currently we only support mysql)")),Object(i.b)("h2",{id:"quickstart"},"Quickstart"),Object(i.b)("ol",null,Object(i.b)("li",{parentName:"ol"},Object(i.b)("p",{parentName:"li"},Object(i.b)("a",{parentName:"p",href:"https://github.com/apache/submarine/tree/master/dev-support/mini-submarine#run-mini-submarine-image"},"Start mini-submarine"))),Object(i.b)("li",{parentName:"ol"},Object(i.b)("p",{parentName:"li"},Object(i.b)("a",{parentName:"p",href:"https://github.com/apache/submarine/tree/master/dev-support/mini-submarine#run-workbench-server"},"Start Mysql server in mini-submarine"))),Object(i.b)("li",{parentName:"ol"},Object(i.b)("p",{parentName:"li"},"Uncomment the log_param and log_metric in\n",Object(i.b)("a",{parentName:"p",href:"https://github.com/apache/submarine/blob/master/dev-support/mini-submarine/submarine/mnist_distributed.py"},"mnist_distributed.py"))),Object(i.b)("li",{parentName:"ol"},Object(i.b)("p",{parentName:"li"},"Start Submarine experiment (e.g., run_submarine_mnist_tony.sh)"))),Object(i.b)("h2",{id:"functions"},"Functions"),Object(i.b)("h3",{id:"submarineget_tracking_uri"},Object(i.b)("inlineCode",{parentName:"h3"},"submarine.get_tracking_uri()")),Object(i.b)("p",null,"return the tracking URI."),Object(i.b)("h3",{id:"submarineset_tracking_uriuri"},Object(i.b)("inlineCode",{parentName:"h3"},"submarine.set_tracking_uri(URI)")),Object(i.b)("p",null,"set the tracking URI. You can also set the\nSUBMARINE_TRACKING_URI environment variable to have Submarine find a URI from\nthere. The URI should be database connection string."),Object(i.b)("p",null,Object(i.b)("strong",{parentName:"p"},"Parameters")),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"URI - Submarine record data to Mysql server. The database URL\nis expected in the format ",Object(i.b)("inlineCode",{parentName:"li"},"<dialect>+<driver>://<username>:<password>@<host>:<port>/<database>"),".\nBy default it's ",Object(i.b)("inlineCode",{parentName:"li"},"mysql+pymysql://submarine:password@localhost:3306/submarine"),".\nMore detail : ",Object(i.b)("a",{parentName:"li",href:"https://docs.sqlalchemy.org/en/latest/core/engines.html#database-urls"},"SQLAlchemy docs"))),Object(i.b)("h3",{id:"submarinelog_metrickey-value-step0"},Object(i.b)("inlineCode",{parentName:"h3"},"submarine.log_metric(key, value, step=0)")),Object(i.b)("p",null,"logs a single key-value metric. The value must always be a number."),Object(i.b)("p",null,Object(i.b)("strong",{parentName:"p"},"Parameters")),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"key - Metric name (string)."),Object(i.b)("li",{parentName:"ul"},"value - Metric value (float)."),Object(i.b)("li",{parentName:"ul"},"step - A single integer step at which to log the specified Metrics,\nby default it's 0.")),Object(i.b)("h3",{id:"submarinelog_paramkey-value"},Object(i.b)("inlineCode",{parentName:"h3"},"submarine.log_param(key, value)")),Object(i.b)("p",null,"logs a single key-value parameter. The key and value are both strings."),Object(i.b)("p",null,Object(i.b)("strong",{parentName:"p"},"Parameters")),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"key - Parameter name (string)."),Object(i.b)("li",{parentName:"ul"},"value - Parameter value (string).")))}b.isMDXComponent=!0}}]);