<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Anne Holler on Medium]]></title>
        <description><![CDATA[Stories by Anne Holler on Medium]]></description>
        <link>https://medium.com/@anne.holler?source=rss-fa2a85501105------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*1d6SvJx16n2A6ojn</url>
            <title>Stories by Anne Holler on Medium</title>
            <link>https://medium.com/@anne.holler?source=rss-fa2a85501105------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 16:07:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@anne.holler/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Nova Just-In-Time K8s Clusters]]></title>
            <link>https://medium.com/elotl-blog/nova-just-in-time-k8s-clusters-e5a4d1dec0d3?source=rss-fa2a85501105------2</link>
            <guid isPermaLink="false">https://medium.com/p/e5a4d1dec0d3</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[kubernetes-cluster]]></category>
            <dc:creator><![CDATA[Anne Holler]]></dc:creator>
            <pubDate>Wed, 12 Apr 2023 19:21:47 GMT</pubDate>
            <atom:updated>2023-04-12T19:21:47.296Z</atom:updated>
            <content:encoded><![CDATA[<h4>Operation &amp; Example Use Case for Low-Risk Multi-Cluster K8s Version Upgrades</h4><p>Author: Anne Holler</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/168/1*K8pQm2fdTkgyu0pPFmDn3A.png" /></figure><h4>ABSTRACT</h4><p>Elotl Nova simplifies the management and usage of multiple K8s workload clusters. Nova introduces a single K8s control plane cluster that automatically schedules K8s objects onto workload clusters in accordance with placement policies.</p><p>Nova has recently been updated to optionally support Just-In-Time cloud workload clusters. When the JIT workload clusters option is enabled, Nova puts cloud clusters that have been idle for a configurable amount of time into standby state. When Nova schedules objects to a standby cluster, Nova brings the cluster out of standby state. Nova can also optionally create a cloud workload cluster, by cloning an existing cluster, if needed to satisfy a placement policy.</p><p>This blog describes the operation of Nova’s JIT workload clusters feature. The blog includes an example Nova JIT use case, which is to facilitate multi-cluster K8s version upgrades. Such upgrades present performance risks to K8s workloads, and mitigating those risks involves the operational complexity of sequencing the upgrades, maintaining cluster capacity during upgrade, and ensuring smooth version rollback if needed. Nova JIT reduces the toil of performing low-risk K8s version upgrades, by handling key steps in the process.</p><h4>INTRODUCTION</h4><p>Kubernetes is a popular system for deploying, scaling, and managing containerized applications in the cloud. Organizations often deploy separate cloud K8s clusters for their various workload categories, tailoring the clusters to each category’s resource needs, usage burstiness, data access requirements, and business criticality. For example, CI/CD workloads may be run on-demand on commodity x86_64 nodes, machine learning (ML) training may be run as scheduled batch jobs on expensive GPU-enabled nodes with large dataset access, and production ML serving may be run on closely-monitored nodes tuned for efficient ML prediction.</p><p>Providing multiple K8s clusters introduces operational complexity, both for the users of the infrastructure and for the team managing it. Elotl Nova reduces the operational complexity for both groups by introducing a single K8s control plane cluster that automatically schedules K8s objects onto the workload K8s clusters. The K8s infrastructure users interact with the control plane cluster for scheduling their workloads, and the team managing the K8s infrastructure defines Nova scheduling policies for placing workloads on the appropriate target cluster.</p><p>Nova has recently been updated to optionally support Just-In-Time cloud workload clusters. When the JIT workload clusters option is enabled, Nova puts clusters that have been idle for a configurable period into standby state. When Nova schedules objects to a standby cluster, Nova brings that cluster out of standby state. Nova can also optionally create a cloud workload cluster, by cloning an existing cluster, if needed to satisfy policy-based placement.</p><p>This blog describes the operation of Nova’s JIT workload clusters feature. The blog includes an example Nova JIT use case, which is to facilitate multi-cluster K8s version upgrades. Such upgrades present performance risks to K8s workloads, and mitigating those risks involves the operational complexity of sequencing the upgrades, maintaining cluster capacity during upgrade, and ensuring smooth version rollback if needed. Nova JIT reduces the toil of performing low-risk K8s version upgrades, by handling key steps in the process.</p><h4>DESCRIPTION</h4><p><a href="https://www.elotl.co/nova.html">Elotl Nova</a> is a multi-cluster multi-cloud control plane that provides policy-driven placement onto workload Kubernetes clusters. Nova presents a single K8s control plane to the user for K8s object placement, and the Nova control plane places those objects on workload K8s clusters, according to the configured policies. Figure 1 depicts Nova’s operation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RZckGJzz6E7G-Gk5" /><figcaption>Figure 1: Elotl Nova Operation</figcaption></figure><p>When the JIT workload clusters option is enabled, Nova puts clusters that have been idle, i.e., have not hosted any Nova-scheduled resource-consuming objects, for a configurable period (default: 3600 seconds == 60 minutes) into standby state. When Nova schedules objects to a standby cluster, Nova brings the cluster out of standby state.</p><p>By default, standby state is implemented by scaling the cluster’s node groups/pools to size 0, while leaving the cluster’s cloud control plane running. Exit from standby involves restoring the node groups/pools original sizes. This suspend/resume mode of operation allows reasonably quick standby state enter/exit (~2 minutes or less each), with the cost in standby being $0.10/hour on both EKS and GKE.</p><p>Optionally, standby state is instead implemented by deleting the cluster from the cloud. Exit from standby involves recreating the cluster and reinstalling the Nova agent software. The delete/recreate alternative reduces the cost in standby to 0, but involves significant latency in entering (3–10 minutes) and exiting (3–15 minutes) standby. Delete/recreate standby can optionally include creating workload clusters, by cloning an existing cluster, if needed to satisfy policy-based placement. Clone creation can be controlled by a configured cluster count limit.</p><p>We note that Nova workload clusters may include a cluster autoscaler. Cluster autoscaling is useful when a cluster’s usage is bursty. Cluster autoscaling is complementary to JIT clusters, and the two technologies work together, with Nova placement for resource availability taking cluster autoscaling into account. <a href="https://www.elotl.co/luna.html">Elotl Luna</a> is an intelligent K8s cluster autoscaler that provisions just-in-time, right-sized, cost-effective compute resources.</p><h4>EXAMPLE USE CASE</h4><p>We consider the use case of Nova JIT facilitating multi-cluster K8s version upgrades. In our example, Nova is managing two workload clusters, one running a development deployment of the application of interest and one running a production deployment of that application, as shown in Figure 2. For the application of interest, we use the guestbook app, deployed as shown in Appendix A1. All three K8s clusters are running on EKS, as shown in Figure 3. Nova JIT standby state is configured to delete the cluster, and Nova JIT cluster creation is enabled.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*htiUMpc_s4hhR6kuFDJSQw.png" /><figcaption>Figure 2: Nova JIT Example Use Case: Nova managing development and production clusters</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZAee4haNX06yhUZ2" /><figcaption>Figure 3: Nova JIT Example Use Case: Nova deployment on EKS K8s clusters before upgrade</figcaption></figure><p>The operator’s goal is to upgrade the workload clusters’ K8s version to 1.25, while managing the risk that the upgrade impacts the application of interest. The strategy for accomplishing this goal is to upgrade the development workload cluster, while maintaining full cluster capacity and having the ability to rollback easily if any problems are observed, and after some soak time, to upgrade the production cluster, again while maintaining full cluster capacity and having the ability to rollback easily if any problems are observed. This upgrade strategy is not satisfied by upgrading each existing workload cluster directly, since the direct approach reduces cluster capacity during the upgrade and complicates rollback. Instead the operator prefers to create a new cluster that is upgraded to K8s version 1.25, and to then cut the application over to the new cluster, with the ability to roll the application back to the old cluster if any issues are observed.</p><p>Using Nova with JIT clusters, the dev cluster upgrade plan can be accomplished in three steps:</p><ol><li>Operator requests the Nova control plane schedule a dummy pod to non-existent cluster -&gt; Nova clone/creates the cluster</li><li>Operator requests K8s upgrade of that new cluster -&gt; Upgrade is low risk, since the cluster is not running any user workloads of interest.</li><li>Operator changes Nova’s dev placement policy to target the new cluster -&gt; Nova reschedules the dev workloads from the old cluster to the new.</li></ol><p>Figure 4 shows execution of these steps for our example. Appendix A2 presents the files policy-create-dev1.yaml and pod-create-dev1.yaml, whose placement triggers cluster clone/creation. The file dev-policy1.yaml modifies the kubernetes.io/metadata.name field in dev-policy.yaml in Appendix A1 to target the new cluster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*J3S4xkdW8dGb4YJ7" /><figcaption>Figure 4: Nova JIT Example Use Case: Nova dev workload cluster upgrade</figcaption></figure><p>After running these steps, the operator monitors the user workloads running on the upgraded dev cluster. If any issues are observed, rollback is performed by changing the dev placement policy back to targeting the original cluster. Once the operator is satisfied with the dev upgrade, upgrade of the prod cluster is performed via applying the three steps to the prod cluster. Again easy rollback to the old cluster is supported if needed. After the old clusters are idle for the configured time, Nova JIT places them in standby as shown in Figure 5 and deletes them from the cloud as shown in Figure 6.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0mZO__jwiKgJwABx" /><figcaption>Figure 5: Nova JIT Example Use Case: Nova cluster upgrade complete; old clusters in standby</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*caEehu3-8izJFt7J" /><figcaption>Figure 6: Nova JIT Example Use Case: Nova deployment on EKS K8s clusters after upgrade</figcaption></figure><p>This example use case has shown how Nova JIT facilitates performing low-risk multi-cluster K8s version upgrades, reducing each cluster upgrade to three steps, with simple rollback if the upgrade impacts user workloads.</p><h4>SUMMARY AND FUTURE WORK</h4><p>We’ve described Nova and its new JIT clusters feature. We’ve presented an example use case in which Nova with Nova JIT facilitates low-risk upgrade of workload cluster K8s version, reducing the upgrade to three steps with simple rollback if the upgrade impacts user workloads.</p><p>We note that Nova with JIT clusters can handle many other use cases as well, e.g.:</p><ul><li>Workload clusters used for different purposes. -&gt; Nova JIT reduces cloud costs without increasing operational complexity.</li><li>Workload clusters used to separate customer trials. -&gt; Nova JIT reduces the operational complexity of managing trial resources.</li><li>Workload clusters providing resources in different regions. -&gt; Nova JIT reduces the operational complexity of handling resource shortfalls.</li></ul><p>We plan to describe these use cases in future blog posts.</p><h4>APPENDIX A1: Deployment of Guestbook App</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mLI1N4AQaqwZ69xn" /><figcaption>Policy-based deployment of the guestbook app on the dev cluster is performed using these commands</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*f7kAhVpHQVdw4shL" /><figcaption>With devpolicy.yaml and dev-namespace.yaml defined as shown here</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*f_mIIB6Q3DV7FUWy" /><figcaption>Policy-based deployment of the guestbook app on the prod cluster is performed using these commands</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bRGQ5n_Vcb-pQMJL" /><figcaption>With prodpolicy.yaml and prod-namespace.yaml defined as shown here</figcaption></figure><h4>APPENDIX A2: Placement triggering cluster creation</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*is-4I3vx_RtrHblz" /><figcaption>Policy targeting a non-existent cluster, along with associated pod placement, triggered cluster clone/creation.</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e5a4d1dec0d3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/elotl-blog/nova-just-in-time-k8s-clusters-e5a4d1dec0d3">Nova Just-In-Time K8s Clusters</a> was originally published in <a href="https://medium.com/elotl-blog">Elotl blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ludwig AutoML for Text Classification]]></title>
            <link>https://medium.com/predibase/ludwig-automl-for-text-classification-7c1759f3b150?source=rss-fa2a85501105------2</link>
            <guid isPermaLink="false">https://medium.com/p/7c1759f3b150</guid>
            <category><![CDATA[automl]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[automl-natural-language]]></category>
            <category><![CDATA[text-classification]]></category>
            <category><![CDATA[nlp]]></category>
            <dc:creator><![CDATA[Anne Holler]]></dc:creator>
            <pubDate>Tue, 03 May 2022 16:14:36 GMT</pubDate>
            <atom:updated>2022-05-03T18:42:29.958Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Authors: Anne Holler, Justin Zhao, Avanika Narayan,Travis Addair, Devvret Rishi, Piero Molino</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2PGREr8ku9PdWgv2.png" /><figcaption>Ludwig v0.5.0 extends v0.4.1 AutoML for tabular datasets to AutoML for text classification datasets</figcaption></figure><h3><strong>INTRODUCTION</strong></h3><p><a href="https://ludwig-ai.github.io/ludwig-docs/">Ludwig</a> is an open-source declarative deep learning (DL) framework that enables individuals from a variety of backgrounds to train and deploy <a href="https://medium.com/ludwig-ai/ludwig-ai-v0-4-introducing-declarative-mlops-with-ray-dask-tabnet-and-mlflow-integrations-6509c3875c2e">state-of-the-art tabular, natural language processing, and computer vision models</a>. Ludwig is a toolkit for end-to-end machine learning, through which users can experiment with different model hyperparameters using Ray <a href="https://docs.ray.io/en/latest/tune/index.html">Tune</a>, scale up to large out-of-memory datasets and multi-node clusters using <a href="https://horovod.ai/">Horovod</a> and <a href="https://docs.ray.io/en/latest/index.html">Ray</a>, and serve a model in production using <a href="https://mlflow.org/">MLflow</a>. Model architecture, training loop, hyperparameter search range, and backend infrastructure are specified in a YAML file using Ludwig’s declarative interface, eliminating the need to write code. By abstracting away the barriers to training and deploying DL models, Ludwig makes developing DL models a simple iterative process.</p><p>Recently, we extended Ludwig to include AutoML, which automatically creates DL models given a dataset, its label column, and a time budget. Ludwig AutoML infers input and output feature types, chooses the model architecture, and specifies the parameters and ranges across which to perform hyperparameter search. Ludwig AutoML returns a set of trained models, sorted by quality metrics. It can also return the YAML configuration file used to generate those models, allowing further model search refinement by the user. We discuss our glass-box AutoML approach, including its goals, design, implementation, use, and usability in this <a href="https://medium.com/ludwig-ai/ludwig-automl-for-deep-learning-cf64de9d49c8">linked blog</a>.</p><p>Our initial AutoML work focused on tabular datasets, since good performance on such datasets is a current area of interest in the DL community and since transfer learning from pre-trained models, which can reduce training complexity for text or image data, is not applicable. In this blog, we report on our subsequent work developing and validating Ludwig AutoML for text classification. As we expected, the ability to fine-tune pre-trained models did simplify basic model type and search space selection for this new AutoML domain. However, we found that managing the significantly greater resources needed for training text models presented a set of additional challenges, which are addressed in the latest version of Ludwig. In the next section, we discuss our selection of initial text classification AutoML heuristics, the opportunities we discovered and exploited for further heuristics improvement, and the validation of the resulting text classification AutoML algorithm.</p><h3><strong>DEVELOPING TEXT CLASSIFICATION AUTOML</strong></h3><p>The key to creating data-informed Ludwig AutoML for text classification is to develop heuristics which support efficiently and automatically producing Ludwig models that have accuracy competitive (within 2%) with models produced manually by experts. As when creating Ludwig AutoML for tabular data, we ran experiments on a variety of datasets to develop the heuristics, and validated the resulting functionality by running AutoML on a different group of datasets.</p><h3>Choosing Initial Text Classification AutoML Heuristics</h3><p>For text classification AutoML, we formed initial heuristics using data from previous work training text classification models, including a case study performed to show the capabilities of the <a href="https://arxiv.org/pdf/2111.04260.pdf">Ludwig Benchmarking Toolkit [LBT]</a>. For the LBT case study, seven model types were trained across nine text classification datasets spanning four kinds of problems.</p><h3>Heuristics development datasets</h3><p>The nine datasets in the LBT study were chosen for their diversity in average input token length, dataset size, and output classes count. For Ludwig AutoML heuristics development datasets, we used six of the nine LBT datasets, replacing three with more widely-used alternatives and including one additional dataset. The <strong>ten Ludwig text classification AutoML heuristics development datasets</strong> are listed in Table 1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iFvtsB6wa-xEJNAY5KEm5w.png" /><figcaption>Table 1: Text Classification Datasets used to develop AutoML heuristics for Ludwig. SST3 is derived from SST5 by collapsing positive and negative classes, while keeping the neutral class.</figcaption></figure><p>Ludwig AutoML identifies text classification datasets as those with a single text input feature and a single output feature. For the three datasets not matching this pattern, we dropped unneeded input columns before passing their associated dataframes to AutoML, removing <em>content_id</em> from <em>goemotions</em> and <em>title</em> from <em>agnews</em> and <em>dbpedia</em>, the latter after concatenating <em>title</em> to the primary input text content field. We note that the maximum input token lengths listed in Table 1 were capped at 512 by the tokenizer library, and the average and 99th percentile input token lengths were measured on the truncated output.</p><h3>Initial heuristics selected</h3><ul><li><strong>Model type: BERT-base</strong>. The seven model types in the LBT case study included five pre-trained language models (BERT-base, DistilBERT-base, Electra-base, RoBERTa-base, and T5-small) and two text encoders trained from scratch (RNN and Stacked Parallel CNN). BERT-base produced the most accurate model for five of the nine datasets, and is often <a href="https://arxiv.org/pdf/2004.03705.pdf">recommended</a> for text classification. Hence, we selected BERT-base as the default model type for Ludwig text classification AutoML. BERT-base is a transformer model, having <a href="https://arxiv.org/pdf/2001.08361.pdf">quadratic</a> behavior with respect to input token length. Its maximum supported input token length is 512. In the LBT case study, the input token length was capped well below the BERT-base maximum for a number of the datasets, and competitive models were produced, so we expected that BERT’s quadratic behavior would be manageable.</li><li><strong>Batch size search range: [16, 32, 64,128]. </strong>In the LBT runs, the BERT-base models were trained with fixed batch sizes, set manually per dataset to the maximum value that would fit in the T4 16G GPU memory. For AutoML, we wanted to make batch size a hyperparameter, with its range automatically customized per dataset (if needed) via Ludwig AutoML’s <em>tune_for_memory</em> option. We set the initial batch size search range to [16, 32, 64,128], which is in line with the Google BERT-base <a href="https://github.com/google-research/bert/blob/master/README.md">README</a>. We note that this batch size set contains much lower values than the set used by Ludwig AutoML for tabular models based on TabNet. TabNet is a smaller model type and Ludwig AutoML uses the following set of higher values [256, 512, 1024, 2048, 4096, 8192].</li><li><strong>Learning rate search range: [0.00002, 0.00003, 0.00005]. </strong>In the LBT case study, the learning rate hyperparameter range was sampled loguniform from 0.00002 to 0.01. Based on the learning rates associated with the best performing LBT models and on published <a href="https://arxiv.org/pdf/1905.05583.pdf">results</a> indicating the learning rate values that avoid catastrophic forgetting when fine-tuning pre-trained models, we set the text classification AutoML learning rate search range to [0.00002, 0.00003, 0.00005]. We note that this learning rate range is again very different from that used by Ludwig AutoML for tabular datasets, which is [0.005, 0.01, 0.02, 0.025]; tabular models are trained from scratch and thus not concerned with catastrophic forgetting of pre-trained knowledge.</li><li><strong>Optimizer: AdamW. </strong>For BERT-base fine-tuning, the AdamW optimizer is often used, rather than the Adam optimizer, which is Ludwig’s default. Fast.ai compares the two optimizers <a href="https://www.fast.ai/2018/07/02/adam-weight-decay/">here</a>. We added AdamW support to Ludwig and used AdamW as the default optimizer for Ludwig AutoML for text classification.</li><li><strong>Maximum Hyperparameter Search Trials: 5. </strong>Ludwig AutoML performs async hyperband hyperparameter search using <a href="https://docs.ray.io/en/latest/tune/index.html">Ray Tune</a>. For tabular datasets, AutoML specifies running up to 10 search trials. For text classification datasets, we reduced the maximum search trials to 5, given the smaller search space in terms of parameters and ranges.</li></ul><h3>Initial heuristics results</h3><p>Using these initial heuristics and default options, we ran AutoML on our ten text classification datasets on a Ray Cluster composed of three <a href="https://aws.amazon.com/ec2/instance-types/g4/">g4dn.2xlarge</a> nodes. While we had standardized on a two hour time budget for tabular data AutoML, we experimented with a one hour time budget for text classification AutoML, given the latter’s use of pre-trained models and its smaller search space. For the short datasets that were also narrow enough to fit in T4 GPU memory (<em>sst2</em>, <em>sst3</em>, and <em>sst5</em>), Ludwig AutoML produced models within the one hour time budget that had accuracy within 2% of published manually-tuned results. The remaining datasets failed to train with the initial AutoML heuristics and default options, overflowing GPU memory.</p><h3>Tuning Text Classification AutoML Heuristics</h3><p>Investigating issues seen with the datasets that failed to train with the initial AutoML heuristics and default options, we found a number of opportunities to tune text classification AutoML. We next discuss these opportunities and then present results with the tuned heuristics and options.</p><h3>Heuristics Tuning</h3><ul><li><strong>Improving the model size estimation.</strong>The Ludwig AutoML <em>tune_for_memory</em> option estimates the model memory footprint and adjusts model parameters like batch size to reduce it to fit into the target memory. We found that the option’s original estimation formula did not include <strong>optimizer bytes per model weight</strong>. With that quantity added, its estimate of worst-case memory usage became <em>(model_weight_count) x (bytes_per_weight + </em><strong><em>optimizer_bytes_per_weight</em></strong><em>) x (batch_size).</em> Worst-case memory size for BERT-base assumes input token lengths of 512. For shorter input token lengths, memory usage can be much lower than the worst case. By default, Ludwig itself limits BERT-base maximum input token length to 256, and that maximum can be further reduced via a Ludwig override. We refined the <em>tune_for_memory</em> memory usage estimate to incorporate the dataset’s effective maximum input token length given its Ludwig settings and we enabled the <em>tune_for_memory</em> option for the datasets that had overflowed GPU memory.</li><li><strong>Limiting the input token length before reducing the batch size range. </strong>LBT experiments showed that limiting input token length to allow larger batch sizes was a good trade-off for obtaining competitive model accuracy under memory pressure. And we observe that for several datasets, average token length is an order of magnitude lower than maximum token length and the 99th percentile length is much lower than maximum as well. We updated <em>tune_for_memory</em> to address estimated model memory overflow by first reducing maximum input token length to the 99th percentile capped at 128, and then reducing batch size range if estimated memory size is still too large. With this update, text classification AutoML on <em>ethos_binary</em>, <em>irony</em>, and <em>goemotions</em> produced BERT-base models in one hour, with the first two achieving competitive model accuracy.</li><li><strong>Revising the hyperparameter search and training goal. </strong>The <em>goemotions</em> model accuracy produced in one hour was not competitive with the results reported by LBT and others. The dataset’s target column is of type <em>set</em> and the Jaccard metric is used to assess model quality. In a detailed comparison of the AutoML and LBT results, we found that AutoML’s loss metric was actually better than LBT’s, but its Jaccard metric was worse. By default, Ludwig AutoML defined the hyperparameter search and training goal as minimizing loss on the combined output features. Always using combined loss as the goal simplified Ludwig AutoML code, but meant that its goal could be misaligned with the metric being used to assess model quality. We modified Ludwig AutoML so that, when run on a dataset with a single output feature, it set the hyperparameter search and training goal to match Ludwig’s preferred metric for that output feature type (see Ludwig documentation). With this change, the Jaccard metric was used as AutoML’s goal for the output feature of type set, and the best model produced by AutoML in one hour for <em>goemotions</em> reached a competitive score.</li><li><strong>Tuning the training loop. </strong>We spent time analyzing AutoML’s runtime performance. We were running on pre-release Ludwig v0.5, which replaces the TensorFlow backend with pyTorch. We found (via <a href="https://github.com/benfred/py-spy">py-spy</a>) that this pre-release code had tuning opportunities in its regularization loss calculation, which we addressed. We switched our zero_grad to include set_to_none, as per the PyTorch performance tuning <a href="https://pytorch.org/tutorials/recipes/recipes/tuning_guide.html">guide</a>. We found that Ray Tune workers did not use the GPU after our tune_for_memory Ray job was run; the Ray team fixed the <a href="https://github.com/ray-project/ray/issues/22504">problem</a> in version 1.12. Also, based on our initial hyperparameter runs, we updated several settings used for text classification AutoML. We reduced the learning rate range to remove 0.00005, since the higher performing models were all associated with lower values. We limited per-trial training to 6 epochs since, with fine-tuning, the first few epochs typically produce the most accurate models.</li><li><strong>Increasing the time budget. </strong>Even with <em>tune_for_memory</em> limiting maximum input token length and batch size search range and with our AutoML performance tuning, AutoML did not produce models for the remaining datasets (<em>yelp_polarity</em>, <em>yelp_reviews</em>, <em>agnews</em>, and <em>dbpedia</em>) in one hour. These datasets have a relatively large number of rows (&gt;100K) and a single epoch can take multiple hours. We increased their time budget, to three hours for <em>agnews</em> and six hours for the others, and AutoML was able to generate competitive models. We considered switching the model type for these datasets from BERT-base to <a href="https://arxiv.org/abs/1910.01108">DistilBERT-base</a>, which has 40% fewer weights. However, model accuracy was impacted for several datasets and it was unclear how to characterize when selecting the smaller model type would impact performance. Hence, we choose BERT-base, when the model is estimated to fit memory; else, DistilBERT-base.</li><li><strong>Changing the model checkpoint and evaluation from epoch- to step-based. </strong>Given the large amount of time needed to run a full epoch for the long wide datasets, we updated Ludwig to optionally switch training and evaluation from epoch-based to step-based. Step-based evaluation allows model quality assessment before completing a full epoch. We ran AutoML on the long wide datasets with step-based model checkpointing and evaluation configured. We specified two evaluations per epoch, with the idea that training on 50% of a long dataset would likely yield a model in line with that produced by training on the full epoch. With this configuration, we were able to get competitive models at the half-epoch point, and were able to reduce the three hour time budget for <em>agnews</em> to two hours and the six hour time budget for the other long wide datasets to four hours. We changed AutoML to set <em>checkpoints_per_epoch</em> to two or more, per dataset length, when <em>tune_for_memory</em> was set for long wide datasets.</li><li><strong>Reducing the model intermediate evaluation overhead. </strong>We observed that the training time overhead for intermediate model evaluation, done at model checkpointing time, is substantial and its relative impact is increased when using sub-epoch evaluation. A key source of that overhead is evaluation on the full training set. To reduce the overhead, we made full training set intermediate evaluation optional. With that option disabled, the time budget to produce competitive models for <em>yelp_polarity</em>, <em>yelp_reviews</em>, and <em>dbpedia</em> is reduced to three hours. We updated AutoML to disable training data intermediate evaluation for long wide datasets when <em>tune_for_memory</em> is set.</li></ul><h3>Improved heuristics results</h3><p>We <a href="https://github.com/ludwig-ai/experiments/blob/main/automl_nlp/heuristics/runstandard.sh">ran</a> Ludwig AutoML with the improved heuristics and option settings on the heuristics development datasets as a sanity-check (see Figure 1). In all cases, the AutoML score with the improved heuristics and option settings is within 2% of the manually-tuned reference score.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cQ_X72lY2szl9ju81AMU2w.png" /><figcaption>Figure 1: Model performance of AutoML vs Manually-Tuned Reference on heuristics datasets as a sanity-check (higher score is better)</figcaption></figure><p>Table 2 includes detailed information on the AutoML sanity check runs. We note that selecting an appropriate time budget for text classification AutoML is dependent on the dataset length and choosing to enable AutoML tune_for_memory is dependent on maximum input token length. Max Token Length shows the value used when tune_for_memory was set and the model was estimated to overflow GPU memory; 40% of the datasets ran with the tune_for_memory limit of 128 and produced competitive models. Checkpoints per Epoch reflects that 40% of the datasets ran with more checkpoints per epoch than default, set by tune_for_memory based on the dataset length. Checkpoints Completed lists the number of completed checkpoints for all trials run across the three Ray Tune workers, with Average Seconds per Checkpoint giving the average times to run training and evaluation for those checkpoints. The highest average times and lowest completed checkpoint counts are associated with the long wide datasets that ran multiple checkpoints per epoch. Without sub-epoch evaluation and reduced evaluation overhead, those datasets would require an unnecessarily doubled time budget to produce a competitive model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dfMdv8MxUkbjGEfc-nBF8g.png" /><figcaption>Table 2: Running AutoML on the datasets used to develop its heuristics as a sanity-check</figcaption></figure><h3><strong>Validating Text Classification AutoML Heuristics</strong></h3><h3>Validation datasets</h3><p>We chose five additional datasets (Table 3) to validate text classification AutoML. Unneeded fields were dropped to yield one input text feature: <em>article_id</em> (<em>bbcnews</em>), <em>edge</em> (<em>reuters</em>, <em>ohsumed</em>), <em>title</em> (<em>amazon_reviews</em>, <em>amazon_review_polarity</em>), the latter two <em>after title</em> was concatenated to the primary input text content field.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SihKxMmXTN9n1bUdf9NbTg.png" /><figcaption>Table 3: Text Classification Datasets used to validate AutoML heuristics for Ludwig</figcaption></figure><h3>Validation results</h3><p>To validate text classification AutoML on these datasets, we needed to set the time budget and to decide whether to enable the <em>tune_for_memory</em> option. The two <em>amazon</em> datasets have an order of magnitude more rows than the longest heuristics datasets, for which we had used three hour time budgets; we specified a five hour time budget for those datasets. The row count for the other datasets was in line with heuristics datasets for which we had used a one hour time budget, so we used a one hour time budget for them. All of the validation datasets have large maximum input token lengths; we enabled the <em>tune_for_memory</em> option for all of them.</p><p>The results of the validation runs are shown in Figure 2. All AutoML scores are within 2% of the corresponding manually-tuned reference scores.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HRhJ8nX9BbWFgHWagjMHOA.png" /><figcaption>Figure 2: Model performance of AutoML vs Manually-Tuned Reference on heuristics datasets as validation (higher score is better)</figcaption></figure><p>In Table 4, we again see AutoML limiting maximum token length, to avoid GPU memory overflow, and setting checkpoints per epoch for long wide datasets, to allow sub-epoch model quality evaluation and stopping.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kPDntsb-JDKAv3D0FkdL1A.png" /><figcaption>Table 4: Running AutoML on the datasets used to validate its heuristics</figcaption></figure><h3>SUMMARY AND FUTURE WORK</h3><p>We presented our work extending Ludwig AutoML to text classification. We leveraged the pre-trained BERT-base model type and found that, while its use simplified the model search space and produced competitive models, its resource requirements presented tuning challenges. We developed AutoML using ten diverse text classification datasets, and validated it worked well on five additional text classification datasets, confirming that Ludwig AutoML can provide robust accuracy within 2% of, and in some cases better than, manually-tuned models.</p><p>We plan to next focus on tuning Ludwig AutoML for additional tasks such as image classification. Tackling text classification made Ludwig AutoML substantially more robust, in particular to large datasets and memory-hungry models, so we expect a similar beneficial effect by tackling new and demanding tasks.</p><h3>GET INVOLVED!</h3><p>The scripts to run AutoML on all of the datasets in this blog are available <a href="https://github.com/ludwig-ai/experiments/tree/main/automl_nlp">here</a>. We invite you to try Ludwig AutoML on your text classification (or tabular) tasks, and to share your experiences!</p><p>And in general, we welcome discussion or contributions from researchers and practitioners alike, and we welcome you all to join the Ludwig open source community!</p><p>We are actively working on a managed platform to bring this novel approach for automated machine learning to organizations at scale through <a href="http://www.predibase.com/">Predibase</a>, a cohesive end-to-end platform built on top of Ludwig, Horovod, and Ray. We’re excited to share more details soon, and if you’d like to get in touch in the meantime, please feel free to reach out to us at <a href="/service/mailto:team@predibase.com">team@predibase.com</a>.</p><h3>APPENDIX: TEXT CLASSIFICATION AUTOML USE</h3><p>The Ludwig AutoML API is <em>auto_train</em>. Here is a simple example of its invocation:</p><pre>auto_train_results = ludwig.automl.auto_train(<br>    dataset=my_dataset_df, # w/train, validation, &amp; test splits<br>    target=target_column_name,<br>    time_limit_s=7200,<br>    tune_for_memory=False<br>)</pre><p>Ludwig AutoML characterizes as text classification an input dataset with a single input text column and a single output column. Many text classification datasets need <em>tune_for_memory</em> set true to avoid gpu memory overflow.</p><p><a href="https://github.com/ludwig-ai/experiments/blob/main/automl_nlp/heuristics/sst2/run_auto_train_standard.py">Here</a> is an example using <em>auto_train</em> on the <em>sst2</em> dataset. The <em>sst2</em> dataset out-of-the-box matches the text classification characterization, fits in gpu memory, and includes all three splits. <a href="https://github.com/ludwig-ai/experiments/blob/main/automl_nlp/heuristics/agnews/run_auto_train_standard.title.py">Here</a> is an example using <em>auto_train</em> on the <em>agnews</em> dataset, needing <em>tune_for_memory</em>. The <em>agnews</em> dataset <a href="https://github.com/ludwig-ai/experiments/blob/main/automl_nlp/heuristics/agnews/load_util.py">preprocesses</a> the dataframe passed to <em>auto_train</em> to provide a single input text column, formed by concatenating its <em>title</em> and <em>description</em> fields and dropping unneeded columns, and to create the validation split.</p><p>The <em>auto_train</em> API uses the heuristics previously described to create a hyperparameter search configuration and to run it for the specified time limit using Ray Tune Async HyperBand. The result is the set of models produced by the search trials, along with a hyperparameter search report, which can be inspected manually or post-processed by Ludwig tools.</p><p>The <em>create_auto_config</em> API outputs auto_train’s hyperparameter search configuration but skips running the search. It takes the same parameters as <em>auto_train</em>; here is a simple example of its invocation:</p><pre>auto_config = ludwig.automl.create_auto_config(<br>    dataset=my_dataset_df,<br>    target=target_column_name,<br>    time_limit_s=7200,<br>    tune_for_memory=False<br>)</pre><p>The <em>create_auto_config</em> API is useful for examining the types chosen for the input and output features, the model type selected, and the hyperparameters and ranges specified. For manual refinement, the API output can be edited and directly used as the configuration for a Ludwig hyperparameter search job. <a href="https://github.com/ludwig-ai/experiments/blob/main/automl_nlp/heuristics/sst5/get_auto_train_config.py">Here</a> is an example invocation of <em>create_auto_config </em>on the <em>sst5</em> dataset, with the associated output given <a href="https://github.com/ludwig-ai/experiments/blob/main/automl_nlp/heuristics/sst5/auto_config.json.automl.master">here</a>.</p><p>The <em>user_config</em> parameter can be passed to <em>auto_train</em> or <em>create_auto_config</em> to override specified parts of the configuration produced. For example, <a href="https://github.com/ludwig-ai/experiments/blob/main/automl_nlp/heuristics/goemotions/run_auto_train_standard.py">this</a> auto_train script for the <em>goemotions</em> dataset specifies that the <em>emotion_ids</em> output feature be set to type <em>set</em> to override Ludwig AutoML type detection system’s characterization of the feature as <em>category</em>.</p><h3>APPENDIX: REFERENCE SCORE LINKS</h3><h3><strong>Figure 1 Reference Score Links</strong></h3><ul><li><a href="https://arxiv.org/pdf/2006.08328v2.pdf">ethos_binary</a></li><li><a href="https://arxiv.org/pdf/2111.04260.pdf">irony</a></li><li><a href="https://paperswithcode.com/paper/fine-grained-sentiment-classification-using">sst2</a></li><li><a href="https://huggingface.co/textattack/bert-base-uncased-yelp-polarity">yelp_polarity</a></li><li><a href="https://huggingface.co/textattack/bert-base-uncased-ag-news">agnews</a></li><li><a href="https://arxiv.org/pdf/2111.04260.pdf">dbpedia</a></li><li><a href="https://scholarworks.iupui.edu/bitstream/handle/1805/27366/AE_Thesis_Fall_2021_Final.pdf?sequence=1">goemotions</a></li><li><a href="https://pythonrepo.com/repo/WadeYin9712-SentiBERT-python-deep-learning">sst3</a></li><li><a href="https://paperswithcode.com/paper/fine-grained-sentiment-classification-using">sst5</a></li><li><a href="https://arxiv.org/pdf/1509.01626.pdf">yelp_reviews</a></li></ul><h3>Figure 2 Reference Score Links</h3><ul><li><a href="https://arxiv.org/pdf/1509.01626.pdf">amazon_review_polarity</a></li><li><a href="https://arxiv.org/pdf/1509.01626.pdf">amazon_reviews</a></li><li><a href="https://www.kaggle.com/competitions/learn-ai-bbc/leaderboard">bbcnews</a></li><li><a href="https://arxiv.org/pdf/1909.08166.pdf">ohsumed_7400</a></li><li><a href="https://arxiv.org/pdf/2111.00702.pdf">reuters_r8</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7c1759f3b150" width="1" height="1" alt=""><hr><p><a href="https://medium.com/predibase/ludwig-automl-for-text-classification-7c1759f3b150">Ludwig AutoML for Text Classification</a> was originally published in <a href="https://medium.com/predibase">Predibase</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ludwig AutoML for Deep Learning]]></title>
            <link>https://medium.com/predibase/ludwig-automl-for-deep-learning-cf64de9d49c8?source=rss-fa2a85501105------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf64de9d49c8</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[automl]]></category>
            <category><![CDATA[benchmark]]></category>
            <category><![CDATA[pytorch]]></category>
            <dc:creator><![CDATA[Anne Holler]]></dc:creator>
            <pubDate>Tue, 15 Feb 2022 17:49:32 GMT</pubDate>
            <atom:updated>2022-02-15T17:49:32.951Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Authors: Anne Holler, Avanika Narayan, Justin Zhao, Shreya Rajpal, Daniel Treiman, Devvret Rishi, Travis Addair, Piero Molino</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FXbOiw147usLKD3G.png" /><figcaption>Ludwig v0.4.1 introduces experimental AutoML with auto config generation integrated w/hyperopt on Ray Tune</figcaption></figure><h3>INTRODUCTION</h3><p><a href="https://ludwig-ai.github.io/ludwig-docs/">Ludwig</a> is an open-source declarative deep learning (DL) framework that enables individuals from a variety of backgrounds to train and deploy <a href="https://medium.com/ludwig-ai/ludwig-ai-v0-4-introducing-declarative-mlops-with-ray-dask-tabnet-and-mlflow-integrations-6509c3875c2e">state-of-the-art tabular, natural language processing, and computer vision models</a>. Ludwig serves as a toolkit for end-to-end machine learning, through which users can experiment with different model hyperparameters using Ray <a href="https://docs.ray.io/en/latest/tune/index.html">Tune</a>, scale up to large out-of-memory datasets and multi-node clusters using <a href="https://horovod.ai/">Horovod</a> and <a href="https://docs.ray.io/en/latest/index.html">Ray</a>, and serve a model in production using <a href="https://mlflow.org/">MLflow</a>. The model architecture, training loop, hyperparameter search range, and backend infrastructure are specified in a YAML file using Ludwig’s declarative interface, which eliminates the need to write code. By abstracting away the barriers to training and deploying DL models, Ludwig makes developing DL models a simple iterative process.</p><p>Currently Ludwig requires that users write a model configuration from scratch: specifying input and output features and types, choosing a model architecture, and describing the training loop as well as the hyperparameter search strategy. Hence, users need to have some familiarity with the attributes of various deep learning models and the effects of training parameters (e.g., learning rate) and model parameters (e.g., model size) on model performance. This knowledge can take significant time to acquire and is typically domain-specific.</p><p>To reduce this learning curve, a number of AutoML solutions have been developed to automate the preprocessing of features and the choice of model architecture and training parameters. Some example AutoML solutions for tabular datasets include <a href="https://arxiv.org/pdf/2003.06505.pdf">AutoGluon-Tabular</a>, <a href="https://cloud.google.com/automl-tables/docs">GCP AutoML Tables</a>, and <a href="https://www.automl.org/automl/auto-sklearn/">Auto-sklearn</a>. While lowering the barrier to entry, the most common critique of AutoML tools today is that they are black-box, providing limited transparency into modeling decisions and little-to-no customizability or control to the end user (<a href="https://arxiv.org/pdf/2101.04834.pdf">Whither AutoML ‘21</a>).</p><p>Ludwig’s simple, declarative, and extensible interface makes it well-suited to support AutoML as a glass-box solution, maintaining flexibility and control for the user. In this blog post, we describe the evolution of the Ludwig AutoML module, which automates the process of building deep learning pipelines in Ludwig. We cover the goals of Ludwig AutoML and provide details about its implementation. Focusing on tabular datasets, we compare the accuracy of its generated models with that of high-performing published models and its usability with several existing AutoML solutions. We give working examples of its invocation and output.</p><h3>LUDWIG AUTOML GOALS</h3><p>Our vision for Ludwig AutoML is that it be simple to use and that its results be easy to understand and refine. This vision leads us to the following goals:</p><ol><li><em>Data-Informed: </em>Use feature data analysis and heuristics derived from historical model training to drive automatic model creation.</li><li><em>Task- and resource-specific</em>: Given task, training, and resource constraints, help users build an appropriate DL pipeline, including the selection of model and hyperparameter search space.</li><li><em>User in-the-loop: </em>Support user input and iterability in model construction.</li><li><em>Black-box → Glass-box</em>: Produce standard accessible tunable models, in contrast to the opaque models generated by a number of AutoML systems.</li></ol><h3>DATA-INFORMED AUTOML</h3><p>The key challenge in creating data-informed Ludwig AutoML is to develop heuristics which support efficiently and automatically producing Ludwig models that have accuracy competitive with models produced manually by experts. Our approach to this challenge was to run an extensive set of hyperparameter training experiments across a variety of datasets, to verify that competitive models were produced by those runs, and then to analyze the runs for patterns we could exploit to produce similarly competitive models automatically using substantially less time and computing resources. We chose to focus on tabular datasets, since good performance on such datasets has been a recent area of interest in the DL community and since the kind of fine-tuning transfer learning which can be used to reduce training time for image or text datasets is not applicable.</p><p>In this section, we’ll first describe how we derived heuristics for automatically creating models for tabular datasets, based on hyperparameter search runs for three DL model types across 12 tabular datasets. We’ll then explain how we incorporated those heuristics into a new AutoML module for Ludwig. And finally, we’ll present our validation of Ludwig’s AutoML module on an additional nine tabular datasets. These results were gathered using the recently-released Ludwig <a href="https://github.com/ludwig-ai/ludwig/releases/tag/v0.4.1">v0.4.1</a> on TensorFlow; the upcoming Ludwig v0.5 release supports AutoML on PyTorch. All results were gathered on a fixed size three node Ray cluster, composed of AWS g4dn.4xlarge nodes; we discuss efficient resource management alternatives for DL training workloads <a href="https://www.cncf.io/blog/2022/02/15/managing-public-cloud-resources-for-deep-learning-training-experiments-and-lessons-learned/">here</a>.</p><p>Table 1 shows the 12 tabular datasets we used to develop AutoML heuristics for Ludwig. We sought diversity in task type (6 binary classification, 3 multi-class classification, 3 regression), dataset length and width, and input column types (percent numeric and category).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1okjR7K0e3cvC9CnPxg2cw.png" /><figcaption><em>Table 1: Tabular Datasets used to develop AutoML heuristics for Ludwig</em></figcaption></figure><p>For our extensive hyperparameter search, we trained DL models for each of the datasets for the three main tabular model types available in Ludwig:</p><ul><li><a href="https://arxiv.org/abs/1908.07442">Tabnet</a> [Google]; uses sequential attention to provide interpretable tabular learning</li><li><a href="https://arxiv.org/abs/2012.06678">Tabtransformer</a> [Amazon]; applies the self-attention method to learn tabular embeddings</li><li><a href="https://ludwig-ai.github.io/ludwig-docs/user_guide/configuration/combiner/">Concat</a> [Ludwig default MLP]; concatenates the encoding layer output and runs the result through fully connected layers</li></ul><p>We used the skopt hyperparameter search technique via Ludwig’s interface to Ray Tune:</p><ul><li>For Tabnet, we searched across 11 hyperparameters</li><li>For Tabtransformer, we searched across 8 hyperparameters</li><li>For Concat, we searched across 5 hyperparameters</li></ul><p>For each training job in the hyperparameter search, we ran up to 300 epochs, with early stopping set to 30 epochs. As previously mentioned, we ran each hyperparameter search job on a fixed size three node Ray cluster, composed of AWS g4dn.4xlarge nodes. Table 2 shows the Compute hours consumed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fpP0yj62YQemXrXcaMrxmQ.png" /><figcaption><em>Table 2: Compute hours consumed for hyperparameter search developing AutoML heuristics for Ludwig</em></figcaption></figure><p>We compared the accuracy of the models found by our search process with those reported publicly for high-performing models, to validate that these tabular model types had sufficient predictive power to be competitive. We then looked for characteristics of our best-accuracy models that we could exploit to automatically produce such models with greatly reduced compute time.</p><p>We observed, looking at the model type results, that Tabnet models:</p><ul><li>were most accurate on average across the datasets</li><li>scaled efficiently as dataset width increased, particularly compared to Tabtransformer</li><li>had the best train-time to model-performance ratio in most cases</li></ul><p>We analyzed the relative importance of each hyperparameter with respect to model accuracy as well as its most impactful subset of values, to identify opportunities to reduce the ranges of hyperparameter search. This allowed substantial reduction in the search space needed to yield high-performing models.</p><p>And finally, we were surprised to find that if we used the best hyperparameter settings for a given model type for dataset X to train a model of that type for dataset Y, that the resulting model would usually be within ~1% of the best model produced by extensive hyperparameter search. This “transfer learning” of hyperparameter configuration settings between datasets can greatly reduce search time, and we are not aware of other AutoML systems exploiting this. We integrated this technique in our package by providing some high performance transferable configurations as an optional initial seed for the hyperparameter search.</p><p>Based on these observations, we created an AutoML module for Ludwig. The Ludwig AutoML module chooses the model type and hyperparameter ranges to search for 10 trials, with the transfer learning model configuration specified as the initial trial to run. Ludwig AutoML includes automatic feature type selection, based on codifying key data attributes that experts use to assign types, but users can override the automatic choice. ​​As a sanity check, we ran Ludwig AutoML with a short (1 hour) time budget on the 12 datasets that we used to create its heuristics. The results are shown in Table 3. In all cases but one, Ludwig AutoML performed within 2% of the best model found by the more extensive searches, which is a positive result. The exception was MercedesBenzGreener, which showed signs of overfitting (the validation score was better but the test score was worse); this is a known challenge with this small wide dataset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EGNU5jtr95EEi9Sp5FN3pQ.png" /><figcaption><em>Table 3: Running AutoML on the datasets used to develop its heuristics as a sanity check</em></figcaption></figure><p>We ran the Ludwig AutoML module to produce models for nine tabular datasets that were not included in the 12 we used to develop our heuristics. The results are shown in Table 4. For each dataset, we report the model accuracy produced by Ludwig AutoML, along with reference scores for high-performing models reported publicly. In each case, the performance of the best Ludwig AutoML model (in bold) is within 2% of the reference model. And the Ludwig AutoML time budget was 2 hours, which is substantially lower than the tens or in some cases hundreds of hours per-model-type hyperparameter searches we ran to get high-performing models in our heuristics formation process. We list the accuracy of the model produced by Ludwig AutoML without and with the optional transfer learning of the hyperparameter settings to show the impact that aspect of Ludwig AutoML can have on efficiently finding high-performing models.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oz1KtUMHsLS_8lIbYs_IUA.png" /><figcaption><em>Table 4: Running AutoML on datasets not used to develop its heuristics as a validation check</em></figcaption></figure><h3>COMPARISON WITH SELECTED AUTOML TOOLS</h3><p>In this section, we compare Ludwig AutoML usability with that of three state-of-the-art AutoML systems for Tabular datasets.</p><p><a href="https://arxiv.org/pdf/2003.06505.pdf">AutoGluon-Tabular</a> is an open-source AutoML framework from AWS that produces ensembles of multiple models stacked in multiple layers. The creators of the framework have shown that the tabular data models created by AutoGluon-Tabular perform well and are produced efficiently relative to those produced by a set of other AutoML systems. While the AutoGluon-Tabular approach is effective at producing high-performing tabular models efficiently, the models that are produced are complex ensembles of models, and as such can present problems in understanding, evolving, and maintaining those models outside of using AutoGluon-Tabular. Ludwig AutoML aims to efficiently produce competitive models that adopt standard DL architectures, for more flexible use and ease of deployment and maintenance.</p><p><a href="https://cloud.google.com/automl-tables/docs">GCP AutoML Tables</a> is a commercial AutoML system from Google. Available as a managed service, GCP-Tables performs model training and prediction via API calls to Google cloud. While GCP-Tables was shown in the AutoGluon-Tabular paper to produce high-performing models with the convenience of cloud computing, its compute efficiency was low relative to a number of other AutoML techniques. Also, the models produced are tied to the Google Cloud platform. In contrast, Ludwig AutoML is transparent and open source, and efficiently produces standard models that are platform-agnostic. And it can easily be run on distributed clusters, thanks to the integration with Horovod and Ray.</p><p><a href="https://www.automl.org/automl/auto-sklearn/">Auto-sklearn</a> uses global optimization across a set of scikit-learn model configurations, and produces an ensemble of all the models tested during the global optimization process. These models include multi-layer neural networks, but not full-fledged deep learning architectures. To speed up the optimization process, auto-sklearn uses meta-learning to identify similar datasets along with knowledge gathered from previous runs. Ludwig AutoML also uses a form of meta-learning by transferring configurations across tasks to speed up its optimization process, but focuses on producing standard non-ensembled DL models that can more easily be further refined or modified by the user.</p><h3>LUDWIG AUTOML USAGE</h3><p>The API for Ludwig AutoML is <strong>auto_train</strong>. Here is a simple example of its invocation:</p><pre>auto_train_results = ludwig.automl.auto_train(<br>    dataset=my_dataset_df,<br>    target=target_column_name,<br>    time_limit_s=7200,<br>    tune_for_memory=False<br>)</pre><p>An example of its use on the Mushroom Edibility dataset can be found <a href="https://github.com/ludwig-ai/experiments/blob/main/automl/validation/mushroom_edibility/run_auto_train_2hr.py">here</a>, in which the dataset, the target column name, and a time limit for the AutoML are passed to the API. The API uses the heuristics previously described to create a hyperparameter search configuration that is run for the specified time limit using Ray Tune Async HyperBand. The result is the set of models produced by the trials in the search, along with a hyperparameter search <a href="https://github.com/ludwig-ai/experiments/blob/main/automl/validation/mushroom_edibility/hyperopt_statistics.json.2hr">report</a>, which can be inspected manually or post-processed by various Ludwig visualization tools. Figure 1 contains the output for <strong>ludwig visualize -v hyperopt_hiplot</strong> run on this hyperparameter search report.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*A9U0kNfd4YLQXbQo" /><figcaption><em>Figure 1: Ludwig visualize -v hyperopt_hiplot on hyperparameter search report</em></figcaption></figure><p>Users can audit and interact with the Ludwig AutoML API in various ways as described below.</p><p>The <strong>create_auto_config </strong>API outputs <strong>auto_train</strong>’s hyperparameter search configuration without running the search. This API is useful for examining the types chosen for the input and output features, the model type selected, and the hyperparameters and ranges specified. Here is a simple example of its invocation:</p><pre>auto_config = ludwig.automl.create_auto_config(<br>    dataset=my_dataset_df,<br>    target=target_column_name,<br>    time_limit_s=7200,<br>    tune_for_memory=False<br>)</pre><p>An example of its use on the Mushroom Edibility dataset is <a href="https://github.com/ludwig-ai/experiments/blob/main/automl/validation/mushroom_edibility/get_auto_train_config.py">here</a>, with the associated results shown <a href="https://github.com/ludwig-ai/experiments/blob/main/automl/validation/mushroom_edibility/auto_config.json.automl">here</a>. For manual refinement, this API output can be edited and directly used as the configuration for a Ludwig hyperparameter search job.</p><p>The <strong>user_config</strong> parameter can be provided to the <strong>auto_train</strong> or <strong>create_auto_config</strong> APIs to override specified parts of the configuration produced. For example, <a href="https://github.com/ludwig-ai/experiments/blob/main/automl/heuristics/walmart_recruiting/run_auto_train_1hr.py">this</a> auto_train invocation for the Walmart Recruiting dataset specifies that the TripType output feature be set to type category to override the Ludwig AutoML type detection system’s characterization of the feature as numerical, based on the presence of 38 non-contiguous integer values in the column. We note that this is one of only two cases, across the 21 datasets we ran, where we needed to override Ludwig AutoML’s automatic type detection.</p><h3>SUMMARY AND FUTURE WORK</h3><p>We have presented the development and validation of Ludwig AutoML for DL. The glass-box API provided in the package embodies Ludwig’s main design principles of marrying simplicity, flexibility, and effectiveness, without having to compromise on any.</p><p>This work focused on Tabular datasets, efficiently producing performance competitive with expert-developed models. We intend to next focus on tuning Ludwig AutoML for image and text datasets, so that the same simple auto_train interface can be used across many structured, unstructured, and semi-structured data tasks.</p><p>We are also actively working on a managed platform to bring this novel approach for automated machine learning to organizations at scale through <strong>Predibase,</strong> a cohesive end-to-end platform built on top of Ludwig, Horovod and Ray. We’re excited to share more details on that soon and if you’d like to get in touch in the meantime please feel free to reach out to us at team@predibase.com.</p><p>We welcome discussion or contributions from researchers and practitioners alike, and we welcome you all to join our open source <a href="https://ludwig-ai.github.io/ludwig-docs/0.4/community/">community</a>!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fdocs.google.com%2Fforms%2Fd%2Fe%2F1FAIpQLSd5rbNqK0E0080nbe_5jFbRKAWm952XfsFfphdBbN8zuv0AeQ%2Fviewform%3Fembedded%3Dtrue&amp;display_name=Google+Docs&amp;url=https%3A%2F%2Fdocs.google.com%2Fforms%2Fd%2Fe%2F1FAIpQLSd5rbNqK0E0080nbe_5jFbRKAWm952XfsFfphdBbN8zuv0AeQ%2Fviewform%3Fusp%3Dsend_form&amp;image=https%3A%2F%2Flh4.googleusercontent.com%2FXouqOwyWDID_d9unrh8cKAzzjJS_nMDZI5IxKjEJ8LE9MZ46kZ7pqM0u0ricpopHZAVcVuE6C30%3Dw1200-h630-p&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=google" width="760" height="675" frameborder="0" scrolling="no"><a href="https://medium.com/media/48cf8600c4f7ca74a490086cf3a0b446/href">https://medium.com/media/48cf8600c4f7ca74a490086cf3a0b446/href</a></iframe><h3><strong>APPENDIX: REFERENCE SCORE LINKS</strong></h3><p>Below are links for the reference scores listed in Table 4.</p><ul><li><a href="https://arxiv.org/pdf/1908.07442.pdf">Higgs</a></li><li><a href="https://www.kaggle.com/benroshan/transaction-fraud-detection">SyntheticFraud</a></li><li><a href="https://paperswithcode.com/paper/fast-accurate-and-simple-models-for-tabular/review/">Numerai28.6</a></li><li><a href="https://www.kaggle.com/uciml/mushroom-classification/discussion/198420">MushroomEdibility</a></li><li><a href="https://arxiv.org/pdf/1908.07442.pdf">ForestCover</a></li><li><a href="https://www.kaggle.com/mohamedzayton/connect4">Connect4</a></li><li><a href="https://www.kaggle.com/odins0n/h2o-ai-automl-regression-house-price-prediction">AmesHousing</a></li><li><a href="https://karanteckwani.wordpress.com/portfolio/protein-tertiary-structure-prediction-using-its-physicochemical-properties/">Protein</a></li><li><a href="https://www.simonwenkel.com/2019/04/19/revisitingML-naval-propulsion.html">Naval</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf64de9d49c8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/predibase/ludwig-automl-for-deep-learning-cf64de9d49c8">Ludwig AutoML for Deep Learning</a> was originally published in <a href="https://medium.com/predibase">Predibase</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>