How do we monitor the performance of the model in case there are a few lines up for the sameutilization?
Howdowecapturethemodellogstotrackthe performanceanddeploymentstatus?
Allthesepointsareverymuchrelevantintoday’sAIML landscapetosuccessfullyimplementandmaintainasolution inproductionenvironment.Inthenextsectiononwardswe will see how wecanleverage the same requirements with somehandsoncustomarchitectures,itsbenefits,limitations andfewsampleusecasesthatwecanaffordthestructure
Limited Budget but Effective End to End MLOps Practices (Machine Learning Model Operationization) in Generic On-Premises Platform Indranil Dutta
How do we capture the Model artifacts for so many numbers of iterations and a reference pointforfuturecomparison?
2. BUSINESS CONTEXT
How do we manage the different versions of codesthatallanalyst/Datascientistcreatesfor differentiterations?
1.INTRODUCTION
Principal Consultant and Lead Data Scientist ***
Whatwedoifthemodelperformancedegrades afterfewiterationspostdeployment?
International Research Journal of Engineering and Technology (IRJET) e ISSN: 2395 0056 Volume: 09 Issue: 02 | Feb 2022 www.irjet.net p ISSN: 2395 0072 © 2022, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page377
In current Data science and Analytics business landscape MLopsisaveryprominentandfascinatingconceptthatmost oftheorganizationsareveryoptimistictoimplementasa partoftheirAIMLinitiatives.Differentleveloforganizations across different lines of business has their own policy to adopttheMLops to orchestrate the workflow. Large scale organizations can easily afford expensive licenses or operational expenses to bring their entire ML pipeline in customizedplatformslikeCloudera ManagerCDP,CML or SDXorusingtheCloudPaaSorIaaS.Therearegamut’s of state of the art options to consume the developed ML pipelinesandpushthesameinrealproductionenvironment andpostdeploymentmonitoringandtrackingwithoutmany difficulties of creating self made architectures and Butarrangements.ifweseetheotheranglesoftheindustry,therearelotof smallplayersinthemarketorstart uporganizationwhoare nurturing their end to end journey with custom architecturesandarrangementsandwithoutaffordingthe expensive SOTA platforms for operationalizing their ML pipelines.
ConsideratypicalMLopsjourneyandwhyitsrequiredto implementforasuccessfulbusinesssolution.Toanswerthe pointsletsunderstandthecontextofthefollowingquestions?
Where do we capture the data and does the single version of data always suffices to meet therequirement?
Howdowecapturethetestiterationsresults?
Howmanytimeswecanmanuallychangesthe pipelines and execute them once there are minor/majorchangesinthecode?
Key Words: MLops,MLpipeline,Onpremises,LowBudget Architecture,MLEngineering
Who will take the initiative to maintain the releaseofthepipelinesincasetherearesome alterations,andthelatestversionshouldbein place?
Abstract : In this research, wouldliketobringa mechanismto implement a typical MLops pipeline for small scale organization who cannot afford the operational expenditures to bring the pipeline at Cloudera, Horton works platform or cloud premises like AWS, GCP or Azure. This paper gives a very detailed understanding of operationalization of a typical ML pipelines to adhere all the elements and artifacts without even using any Docker, Kubernetes or even any API generating platforms like Flask or FastAPI. Using the combination of a simple Python/R along with SQL and Shell scripts we can manage the entire workflow at on premises with a very low cost approach. From some angle this mechanism would not be comparable with the architectures like market ready MLops platforms like Azure Devops, MLflow, Kubeflow, Apache Airflow, Databricks with Data factory or Sagemaker Studio workflow but from conceptual point of view, suffice almost 90% of the requirements with efficient manner.
HowdoweprofiletheModelinfrastructurefor a businessseamlessproductionexecutionbasedupontherequirement?

The entire flow is also embedded with three promising concepts like Continuous Integration (CI), Continuous Deployment (CD) and Continuous training (CT) pipelines. TheseisthestandardstructureofadesiredMLopsstructure andnowlestexplainhowtheserequirementscanbeserved usingacustomcode basedarchitectureandhowmuchwe canachievewithoutusinganystate of the artarchitectures.
Figure -1: AtypicalMLOpsflow typicalMLOpsflowcomprisetheabove mentionedsteps herearethedetails. Code Management: Code versioning and maintenance Data Management: Versioning,IncrementalorFull Load,CentralLocation Model Building:LogAllmetrices,Logsandartifacts, organizing Multiple iterations, Central locations, Meta data and Data Lineage, Provisioning Infrastructure Model Management: CentralLocation,Versioning, Logs,Outputs,HyperParameters,plots,MetaData Model Profiling: Memory and processor requirements. Model Deployment: Automated deployment, provisioning infrastructure, End point versioning, TrafficManagement(scaleupandscaleout) Smoke Test: End Point Health, Positive and NegativeUnittests Data Capture: Real time input and prediction capture,Centrallocationandtimecapture Governance: Model approve/Rejection, Notifications Model Drift:fluctuationonexpectedModeloutcome Data Drift: Unexpectedfeaturebehaviorchange Update: Keepthemodelupdate,retraining, versioning based on latest dataset and code integration.
4. SOLUTIONFigureDESIGN2: AgenericflowofaAIMLsolution WithoutthinkingfromatypicalMLopscycle,thesearethe standardrequirementstoserveasuccessfulMLoperational pipelinewhichcomprisesthefollowingsteps: IdentifyingBusinessProblem Feasibility Analysis of the problem for any AIML solution ScopeMeasurementandestimation DataSourceexplorationandIntegration DataPreparationandDataengineering ExploratorydataAnalysisandvisualization FeatureEngineeringandexploration Featureselectionandfinalization Modelbuilding,training,anditerations HyperParameterturningandoptimization CrossValidation Modelvalidationandtesting ModelFinalization ModelSerialization
Model
3. ELEMENTS OF A TYPICAL MLOPS PIPELINE
A
© 2022, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page378 and some sample cases where the solution is unable to provide a very elastic scalable support towards the requirements.
and
International Research Journal of Engineering and Technology (IRJET) e ISSN: 2395 0056 Volume: 09 Issue: 02 | Feb 2022 www.irjet.net p ISSN: 2395 0072



Continuous Deployment: Therewouldbetheshellscripts which keep executing the pipelines through a CRON scheduler on periodic basis. Whenever the .YAML files uploadsthechangeswillautomaticallyupdatesinthebase codeandduringthe.shpipelineexecutionthechangewillhit the model files. Hence, we are not configuring any trigger based continuous deployment, but this is a periodic deploymenttokeepthemodelfilesupdatedwithrespectto anychangesinthebasecode.
Model Drift: This is a embedded part of the Continuous training pipeline and also be explained in a subsequent section.
Source Code repository: All the required codes like data preparationandtransformationSQLcodes,Modelexecution or scoring codes on Python or R, dependency codes and config files, Shell scripts that also merge few of the transformationandmodelexecutioncodesinauniqueflow. In a nutshell this is a centralized location to cater all the sourcecodesindividuallyorthroughapipeline.
Along with the basic steps also the following needs to be takencarealso Howthecodechangeseffectsonthecoderepository andmodelrelease(finalone)
Governanceoftheentirepipelineandnotification
Continuous Training: This concept will also cover separately in a different section but already taken care in thisarchitecture.
Automatingthepipelinesoitcanconsumethelive dataoneachiterationandcancompletetherequire performance.
International Research Journal of Engineering and Technology (IRJET) e ISSN: 2395 0056 Volume: 09 Issue: 02 | Feb 2022 www.irjet.net p ISSN: 2395 0072 © 2022, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page379 ModelDeployment LogMaintenanceandMonitoring Modeldriftcalculation Datadriftcalculation
Computation Platform: This is the engine where all the codeswillexecute,itcouldbeaUNIXbasedplatformoran AnacondaenvironmentoraRStudioserver.Theprocessing capacitywouldbedefinedandvariedbasedupontheserve memoryandspaceallottedforthespecificjob.
:Thisisacentralizedrepositoryofallthe model files that are generated by the data scientists and based on the version number the required one can be accessed from the repository. This is also a serve based repository and the no of model and its size also depends upontheserverspaceandcapacity.
Continuous Integration: There would be separate config fileslike.YAMLwhichcatersalltheparametersdetailsand inthe release codes will be parametricandcall the config filesduringtheexecution.Datascientistwillonlymakethe changesintheconfigfilesandinsubsequentexecutionthe changeswillreflectinthebasecode.Henceinaverymanual waytheintegrationcanbetakenplace.
Continuouscomparingthemodelperformanceand incase of any significant deviation trigger the continuous training pipeline to retrain the model andthefreshonewouldplacefornextiterationand thesameprocesswillkeepgoingon.
Few of the core components of the architecture and its application: Centralized Feature Repository: There is a single data repositorywhichalsocomprisesmultipleFeaturemartsthat also comprises different work profiles and, in a nutshell, thesearetheuniquesourceofincrementalloadwherethe multiplefeaturemartscombinedtogeneratethelivedatafor the model consumption. There would be a feature of data drift calculation that we will discuss in later phase. For future reference also the repository maintains the data versioningwhichusedforeachiteration.
5 CORE CONCEPT Now let’s discuss the core operational concept of the discussedsolutionindetails
NOTE: The entire flow is describing from a single data scientist experiment point of view for the simplicity. But the same structure can handle the same workload for multiple data scientist as well based on the server space and Modelcapacity.repository
Figure 3: AtypicalModeloperationalizationworkflow


Data Drift: This is also an individual topic that we will discussinaseparatesection.
Thisisaverycrucialstepsandwouldliketoelaboratestep bystep.1.
3. Now the shell script will make the execution and comparetheresultswiththebenchmarkorwiththe resultoflastexecution(T 1)and(T 2).Incasethere isanysignificantchangeswecallthisasmodeldrift.
4. Thistriggersanotherpipelinewereconsumingthe processed data at Time window T a retrainable python script will execute and generate a new modelversion(TimewindowT).
This is in a nutshell a snapshot of the model execution workflow which covers the versioning and end to end integrationandentirepipelinewouldbeembeddedthrough ashellscriptandthesamewillscheduledthroughacronfor periodicexecutionbaseduponthebusinessrequirement.
The flow is here depicting that the core computational platformwillcallthelatestmodelfilesbased ontheuser’s discretion and the specific code version from the code repositorywhichisalreadyintegrated.Finally,itconsumes thelivedatablockfromtheunifiedfeaturestoreandthen complete the execution in the platform and generates the outputfilethroughacsv,alogfileandthemodelartifacts and relevant metrices with .txt file which will store in a modeloutputrepositoryforfuturereferences.
5. Now compare the KPIs of the model of Time windowTalongwiththemodelofTimewindow(T 1)and(T 2)andthendecidewhichonewouldbe productionizedatthatmoment.Thistypeofmodel deployment is called a BLUE GREEN deployment and finally based upon the comparison (A/B testing)it’sbeendecidedwhetherwewillgoforthe bluemodelorGreenone.
Fromthedatarepository(uniquefeaturestorethe live data block would be ready for the current timestamp WindowT)
Figure 4: Anexecutionworkflow
6. Thenthefinal model would deploy on serverand the subsequent scoring will happen from these modelsitself. This is how the model drift monitoring will happen along withthecontinuoustraining.Thisisacontinuousiterative processandwhenevertherewouldbeasignificantdriftand newlivedata blockwillhitthepipelinethesameexercise willhappenandupdatethemodelinthetargetsever.
Visualization/Result or Drift showcasing: For this purpose,wearenotusinganythird partytoolslikeTableau orpowerBI.InpythonowncapabilitywecanuseDtaleor Sweetviztocreateinteractivevisualization withinJupyter environmentandcandraganddropfeaturestoshowcasea presentableoutcome.
2. Usingthesqltransformationtheprocesseddatais readyforthemodelconsumption,thatisalsoforthe sametimewindowT.
6. MODEL DRIFT & CONTINOUS TRAINING PIPELINE
© 2022, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page380
International Research Journal of Engineering and Technology (IRJET) e ISSN: 2395 0056 Volume: 09 Issue: 02 | Feb 2022 www.irjet.net p ISSN: 2395 0072
Governance: The logging mechanism will be there to monitor and notify against all the key performance and selection/rejectionofthespecificversionofthemodelsand thefinalacceptancecriteria.
Figure 5: CTpipelinewithmodeldriftcalculation



Nowperformance.therearegenerallytwodifferenttypesofparameter numericandcategorical.Forcategoricalwewillsimplycheck thedistributionofthelaggedversionandthecurrentversion andinterpretthesamevisuallyusingthePandasprofiling, SweetVizorDtaleplatform. For the numeric variables’ median is a better statistical benchmarkandwewillcomparethesameforthelatestdata withrespecttothelastversiondataandplotthedriftbased onthedistributionmedianofthenumeric values.Nowwe willmultiplethemodelimportanceratio(normalizedone) alongwiththedriftparametersandcalculatetheimpact.
Now once there would be significant drift in the data for those important parameters then only this will impact the modelperformance.Incasetherearehugedriftwithsome parameters which is not at all a driver parameter for the model will not cause much fluctuation in the model
Therearefewothertypesofusecasethatdemandsrealtime results or distributed processing for massive performance issuesorhigh endcognitivevisionorNLPusecasesoruse casesthatrequiresmassivescalability/elasticityconcern cannotbesuitableforthistypeofvanillaMLOpsarchitecture.
Mostly all predictive Models, Regression problems, Time seriesforecasting,Optimizationproblemsusingbatchdata can be fitted in this mechanism properly where elasticity/scalability/loadbalancingisnotaconcern.
7. DATA DRIFT & IMPACT ANALYSIS
CustomerChurnpropensityModel
10. BENEFITS Absolutely low computation cost in terms of memory,tools,licensesandapplicationplatforms. Maintenance is easy because the underlying structureiseasy,anyonecaneasilyadoptthesame. NoneedforanyGPU/TPUtypeexecution. Verymuchtransparentandexplainablesolution,no hiddenstatefortheentirepipeline. Very much use full for the novice data scientist becausethesimplePython,R,SQLandshellscript willsuffice95%oftherequirements. Nocostforanythird partyvisualization.
TherearefewsampletraditionalAIMLusecasethatfitsin thisstrictureandperformswell:
MarketingMixModel CustomerLifetimeValue CreditScoringModelforBanking Upsell/CrossSellmodelformarketing DemandandsalesforecastingModel
9. SAMPLE USE CASE DOESN’T FITS THE ARCHITECTURE
Figure 6: Datadriftengagement
Thisisaveryinterestingsolutiontoidentifyandvisualizethe datadriftandsubsequentimpactanalysis. Herethefinaltrainingwillgeneratethemodelfileandthelist ofimportantparametersalongwithdegreeofimportance.
Fewofthesampleusecasesare Realtimeanomalydetectionontelemetrydata AbstractivetextsummaryusingAttentionmodel SCMoptimizationatWalmart’sscale ImagesegmentationusingmaskRCNN DocumentIntelligenceusingNLP Inthosecases,wehavenootherchoiceotherthanusingthe so called state of the art MLOps platforms mostly from all three major cloud providers like GCP Kubeflow, Azure DevopsorDatabricksMLfloworAWSSagemakerstudio.The heavy computation pytorch, ONNX or TensorFlow type of computation doesn’t fit properly with this type of architecturewhichactuallybuilttocaterthegenericmachine learningproblemsforsmallscaleindustry.
8. SAMPLE USE CASE FITS INTHIS ARCHITECTURE
International Research Journal of Engineering and Technology (IRJET) e ISSN: 2395 0056 Volume: 09 Issue: 02 | Feb 2022 www.irjet.net p ISSN: 2395 0072
© 2022, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page381
Thereby its very robust solution to estimate the impact causedbyeachparametersdriftandthesamecanbelogged foralliterationsforfuturereferences.


© 2022, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page382
CancaterbigchunkdatausingModinpandas,Dask orVaex(Pythoninbuiltcapabilities)
UsePythoninbuiltparallelismusingallcoresofthe server to distribute the processing capability withoutinvolvinganysparkorcloudcapability.
Easilyintegratedwithanyon premisesdatabases likeSSMS,OracleSQL,SQLserver,Teradata.
11. LIMITATIONS
Finally, the solutions have a solid background for lot of small scaleindustriesorevenlargescalesthoseusesbefore 10yearswheretherewasnoexistenceofthesestateofart MLops platforms. In some of the cases its still very much effective and cost savings but in some cases, it has some limitations.Thisisaverycustomsolutionandbeadjusted basedupontherequirementswhereaswecannotadjustthe architectureorworkflowofanySOTAplatformsforourown ease. Definitely lot of additional coding involves implementingthestructureforanend to endsolution,The mainobjectiveofsharingthearchitectureforthosenovice datascientiststotesttheframeworkandgainsomein depth knowledge of how MLOps is actually working rather than usingadragandDropDAGplatformswhichisagreyboxor black box mechanism doesn’t actually explains the core processing at very ground level. I would really encourage junior practitioners to test the architectures on your own handstogetabetterflavorofthecoreMLOpsblocks.
Indranil Dutta is a Principal consultantandLeadDatascientist with more than 11 years of rich experience in Data science and Artificial Intelligence in various industries.Hiscorecompetencyis indeliveringscalableDatascience and AI projects in Big data and Cloudenvironments.
3.OverviewofMLOps KDnuggets
Therearefewlimitationsaswelltousethearchitecture: NotusefulforanyTensorFlow,Pytorchorcomplex NLPtask Notsuitableforhighlyscalablesolutions
12. CONCLUSIONS
International Research Journal of Engineering and Technology (IRJET) e ISSN: 2395 0056 Volume: 09 Issue: 02 | Feb 2022 www.irjet.net p ISSN: 2395 0072
CannotusedforRealtimerequirements. Also,limitationwhereTBsofdataloadisinvolved. Cannot useful once data source be in HDFS, snowflake, RDS, Redshift, Athena, S3, EMR, BigQuery, BigTable, cosmos DB, Synapse or ADLS gen2.
REFERENCES
4.Forrester:Thefutureofmachinelearningisunstoppable (cloudera.com)
BIOGRAPHIES
uthor Photo
1. MLOps:Continuousdeliveryandautomationpipelinesin machinelearning | GoogleCloud 2.MLOpsPrinciples(ml ops.org)

