Program Context Transition

By identifying and migrating code fragments to specialized resources based on pattern recognition and characterization, the method addresses inefficiencies in program context migration, optimizing resource utilization and transfer times.

JP7796764B2Active Publication Date: 2026-01-09INTERNATIONAL BUSINESS MACHINE CORPORATION
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
JP2023556776
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2021-03-30
Filing Date
2022-03-07
Publication Date
2026-01-09
Estimated Expiration
2042-03-07

AI Technical Summary

Technical Problem

The live migration of program contexts to different computing environments is hindered by large checkpoint sizes and lengthy network transfers, particularly when specialized resources are required for certain code portions, leading to inefficiencies in resource utilization and transfer times.

Method used

A method for identifying and migrating code fragments to specialized resources based on pattern recognition and characterization, injecting checkpoints at optimal spots, and seamlessly transitioning program contexts using machine learning models to predict computational intensity and user interactivity.

Benefits of technology

Efficiently utilizes diverse computing resources by identifying and migrating computationally intensive or interactive code fragments to specialized processors, reducing transfer times and resource consumption while maintaining seamless execution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007796764000001
    Figure 0007796764000001
  • Figure 0007796764000002
    Figure 0007796764000002
  • Figure 0007796764000003
    Figure 0007796764000003
Patent Text Reader

Abstract

A collection of code fragments can be received to be loaded into the interactive development platform for execution on a first processor. Candidate fragments within the collection of code fragments for migration to a second processor can be determined based on characterizing the collection of code fragments. Spots within the collection of code fragments can be identified for injecting code for saving a program context based on positions of the candidate fragments within the collection of code fragments. The code for saving a program context can be injected into the identified spots. In response to the code for saving a program context being executed on the first processor and based on the criteria, the program context can be migrated to the second processor.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] This application relates generally to computers and computer applications, and more particularly to program migration, including identifying sweet spots for program context migration based on code pattern recognition and fragment characterization. [Background technology]

[0002] Program developers and data scientists or other users may develop applications and computer models using development technologies that allow for an ordered group of cells, each containing source code or markup for document rendering. Such development technologies enable a type of literate programming, in which source code and its output are located close together. An example of such a technology is Jupyter Notebook. Some portions of code may require or benefit from specialized computing resources (e.g., accelerators such as graphical processing units (GPUs) or field programmable gate arrays (FPGAs)) or large computing machines (e.g., supercomputers) to process those portions in a feasible amount of time.

[0003] The live migration process may begin by stopping the process just before the migration begins, saving its execution context to a file, transferring that file over the network to the new host computer, restoring it on the new host, and continuing execution from where it stopped. However, depending on the state of the process, the size of the checkpoint may be very large, and the transfer over the network may take a long time to complete. Summary of the Invention

[0004] This summary of the present disclosure is provided to aid in understanding the computer system and method of program migration and is not intended to limit the disclosure or the present invention. It should be understood that various aspects and features of the present disclosure may be used advantageously in some cases separately or in other cases in combination with other aspects and features of the present disclosure. Accordingly, variations and modifications may be made to the computer systems and their methods of operation to achieve different results.

[0005] In one aspect, a computer-implemented method can include receiving a collection of code fragments to be loaded into an interactive development platform for execution on a first processor. The method can also include determining candidate fragments within the collection of code fragments for migration to a second processor based on characterizing the collection of code fragments. The method can also include identifying spots within the collection of code fragments for injecting code for saving program context based on positions of the candidate fragments within the collection of code fragments. The method can also include injecting the code for saving program context into the identified spots. The method can also include migrating the program context to the second processor in response to the code for saving program context running on the first processor and based on a criterion.

[0006] In one aspect, a method can efficiently utilize different types of computer resources based on characteristics of the program fragments to efficiently operate the program.

[0007] In another aspect, a computer-implemented method can include receiving a collection of code fragments to be loaded into an interactive development platform for execution on a first processor. The method can also include determining candidate fragments within the collection of code fragments for migration to a second processor based on characterizing the collection of code fragments. The method can also include identifying spots within the collection of code fragments for injecting code for saving program context based on positions of the candidate fragments within the collection of code fragments. The method can also include injecting the code for saving program context into the identified spots. The method can also include migrating the program context to a second processor in response to the code for saving program context running on the first processor and based on the criteria. The method can also include migrating the candidate fragments to the second processor.

[0008] In yet another aspect, a computer-implemented method can include receiving a collection of code fragments to be loaded into an interactive development platform for execution on a first processor. The method can also include determining candidate fragments within the collection of code fragments for migration to a second processor based on characterizing the collection of code fragments. The method can also include identifying spots within the collection of code fragments for injecting code for saving program context based on positions of the candidate fragments within the collection of code fragments. The method can also include injecting the code for saving program context into the identified spots. The method can also include migrating the program context to the second processor in response to the code for saving program context running on the first processor and based on the criteria. The method can also include receiving from the second processor updated program context generated in response to the candidate fragments running on the second processor. The method can also include continuing operation of the collection of code fragments on the first processor.

[0009] In yet another aspect, a computer-implemented method can include receiving a collection of code fragments to be loaded into an interactive development platform for execution on a first processor. The method can also include determining candidate fragments within the collection of code fragments for migration to a second processor based on characterizing the collection of code fragments. The method can also include identifying spots within the collection of code fragments for injecting code for saving program context based on positions of the candidate fragments within the collection of code fragments. The method can also include injecting the code for saving program context into the identified spots. The method can also include migrating the program context to the second processor in response to the code for saving program context running on the first processor and based on the criteria. The interactive development platform can include an interactive computing notebook.

[0010] In yet another aspect, a computer-implemented method can include receiving a collection of code fragments to be loaded into an interactive development platform for execution on a first processor. The method can also include determining candidate fragments within the collection of code fragments for migration to a second processor based on characterizing the collection of code fragments. The method can also include identifying spots within the collection of code fragments for injecting code for saving program context based on positions of the candidate fragments within the collection of code fragments. The method can also include injecting the code for saving program context into the identified spots. The method can also include migrating the program context to the second processor in response to the code for saving program context running on the first processor and based on the criteria. Characterizing the collection of code fragments can include determining a computational intensiveness of each fragment within the collection of code fragments.

[0011] In another aspect, a computer-implemented method can include receiving a collection of code fragments to be loaded into an interactive development platform for execution on a first processor. The method can also include determining candidate fragments within the collection of code fragments for migration to a second processor based on characterizing the collection of code fragments. The method can also include identifying spots within the collection of code fragments for injecting code for saving program context based on positions of the candidate fragments within the collection of code fragments. The method can also include injecting the code for saving program context into the identified spots. The method can also include migrating the program context to the second processor in response to the code for saving program context running on the first processor and based on the criteria. Characterizing the collection of code fragments can include determining a computational intensity of each fragment within the collection of code fragments. The computational intensity can be determined based on using known computationally intensive code fragments.

[0012] In another aspect, a computer-implemented method can include receiving a collection of code fragments to be loaded into an interactive development platform for execution on a first processor. The method can also include determining candidate fragments within the collection of code fragments for migration to a second processor based on characterizing the collection of code fragments. The method can also include identifying spots within the collection of code fragments for injecting code for saving program context based on positions of the candidate fragments within the collection of code fragments. The method can also include injecting the code for saving program context into the identified spots. The method can also include migrating the program context to the second processor in response to the code for saving program context running on the first processor and based on the criteria. Characterizing the collection of code fragments can include determining a computational intensity of each fragment within the collection of code fragments. The computational intensity can be determined based on using known computationally intensive code fragments. The computational intensity can be determined based on training a machine learning model to predict the computational intensity of the fragments based on known computationally intensive code fragments.

[0013] In yet another aspect, a computer-implemented method can include receiving a collection of code fragments to be loaded into an interactive development platform for execution on a first processor. The method can also include determining candidate fragments within the collection of code fragments for migration to a second processor based on characterizing the collection of code fragments. The method can also include identifying spots within the collection of code fragments for injecting code for saving program context based on positions of the candidate fragments within the collection of code fragments. The method can also include injecting the code for saving program context into the identified spots. The method can also include migrating the program context to the second processor in response to the code for saving program context being executed on the first processor and based on the criteria. Characterizing the collection of code fragments can include determining a computational intensity of each fragment within the collection of code fragments. The computational intensity can be determined based on an operation time of the code fragment and an interactive pattern associated with the code fragment.

[0014] In another aspect, a computer-implemented method can include receiving a collection of code fragments to be loaded into an interactive development platform for execution on a first processor. The method can also include determining candidate fragments within the collection of code fragments for migration to a second processor based on characterizing the collection of code fragments. The method can also include identifying spots within the collection of code fragments for injecting code for saving program context based on positions of the candidate fragments within the collection of code fragments. The method can also include injecting the code for saving program context into the identified spots. The method can also include migrating the program context to the second processor in response to the code for saving program context running on the first processor and based on the criteria. The method can also include adding interactive graphical elements depicting the candidate fragments to a user interface window of the interactive development platform, the interactive graphical elements providing a user with an option to migrate the candidate fragments for execution on the second processor.

[0015] In another aspect, a computer-implemented method can include receiving a collection of code fragments to be loaded into an interactive development platform for execution on a first processor. The method can also include determining candidate fragments within the collection of code fragments for migration to a second processor based on characterizing the collection of code fragments. The method can also include identifying spots within the collection of code fragments for injecting code for saving program context based on positions of the candidate fragments within the collection of code fragments. The method can also include injecting the code for saving program context into the identified spots. The method can also include migrating the program context to the second processor in response to the code for saving program context running on the first processor and based on a criterion. The criterion can include a size of the program context meeting a threshold.

[0016] In another aspect, a computer-implemented method can include receiving a collection of code fragments to be loaded into an interactive development platform for execution on a first processor. The method can also include determining candidate fragments within the collection of code fragments for migration to a second processor based on characterizing the collection of code fragments. The method can also include identifying spots within the collection of code fragments for injecting code for saving program context based on positions of the candidate fragments within the collection of code fragments. The method can also include injecting the code for saving program context into the identified spots. The method can also include migrating the program context to a second processor in response to the code for saving program context running on the first processor and based on the criteria. The second processor has greater computing power than the first processor.

[0017] In another aspect, a computer-implemented method can include receiving code fragments to be loaded into an interactive development platform for execution on a first processor. The method can also include determining candidate fragments for migration from the code fragments to a second processor based on determining a computational intensity associated with each of the code fragments. The method can also include identifying a spot within the code fragment for saving a program context. The method can also include injecting computer instructions for saving the program context into the identified spot. The method can also include determining whether migrating the program context or migrating the code fragment that generated the program context is more cost-effective in response to the computer instructions for saving the program context running on the first processor. The method can also include migrating the program context to the second processor in response to determining that migrating the program context is more cost-effective. The method can also include migrating the code fragment that generated the program context to the second processor in response to determining that migrating the code fragment that generated the program context is more cost-effective.

[0018] In another aspect, a computer-implemented method can include receiving code fragments to be loaded into an interactive development platform for execution on a first processor. The method can also include determining candidate fragments for migration from the code fragments to a second processor based on determining a computational intensity associated with each of the code fragments. The method can also include identifying a spot within the code fragment for saving a program context. The method can also include injecting computer instructions for saving the program context into the identified spot. The method can also include determining whether migrating the program context or migrating the code fragment that generated the program context is more cost-effective in response to the computer instructions for saving the program context running on the first processor. The method can also include migrating the program context to the second processor in response to determining that migrating the program context is more cost-effective. The method can also include migrating the code fragment that generated the program context to the second processor in response to determining that migrating the code fragment that generated the program context is more cost-effective. Whether migrating the program context or the code fragment that created it is more cost-effective can be determined based on the size of the program context and the processing time required to run the code fragment that created it.

[0019] In another aspect, a computer-implemented method can include receiving code fragments to be loaded into an interactive development platform for execution on a first processor. The method can also include determining candidate fragments for migration from the code fragments to a second processor based on determining a computational intensity associated with each of the code fragments. The method can also include identifying a spot within the code fragment for saving a program context. The method can also include injecting computer instructions for saving the program context into the identified spot. The method can also include determining whether migrating the program context or migrating the code fragment that generated the program context is more cost-effective in response to the computer instructions for saving the program context running on the first processor. The method can also include migrating the program context to the second processor in response to determining that migrating the program context is more cost-effective. The method can also include migrating the code fragment that generated the program context to the second processor in response to determining that migrating the code fragment that generated the program context is more cost-effective. A plurality of spots for saving program context within the plurality of code fragments can be identified, and the method can further include selecting which of the plurality of spots to migrate any checkpoint created at based on a program context size of the checkpoint and a processing time of the code fragment that created the checkpoint.

[0020] In another aspect, a computer-implemented method can include receiving code fragments to be loaded into an interactive development platform for execution on a first processor. The method can also include determining candidate fragments for migration from the code fragments to a second processor based on determining a computational intensity associated with each of the code fragments. The method can also include identifying a spot within the code fragment for saving a program context. The method can also include injecting computer instructions for saving the program context into the identified spot. The method can also include determining whether migrating the program context or migrating the code fragment that generated the program context is more cost-effective in response to the computer instructions for saving the program context running on the first processor. The method can also include migrating the program context to the second processor in response to determining that migrating the program context is more cost-effective. The method can also include migrating the code fragment that generated the program context to the second processor in response to determining that migrating the code fragment that generated the program context is more cost-effective. The method may also include waiting for the second processor to run the candidate fragment and receiving an updated program context associated with running the candidate fragment.

[0021] In another aspect, a computer-implemented method can include receiving code fragments to be loaded into an interactive development platform for execution on a first processor. The method can also include determining candidate fragments for migration from the code fragments to a second processor based on determining a computational intensity associated with each of the code fragments. The method can also include identifying a spot within the code fragment for saving a program context. The method can also include injecting computer instructions for saving the program context into the identified spot. The method can also include determining whether migrating the program context or migrating the code fragment that generated the program context is more cost-effective in response to the computer instructions for saving the program context running on the first processor. The method can also include migrating the program context to the second processor in response to determining that migrating the program context is more cost-effective. The method can also include migrating the code fragment that generated the program context to the second processor in response to determining that migrating the code fragment that generated the program context is more cost-effective. Computational intensity can be determined based on the execution time of the code fragment and the interactive patterns associated with the code fragment.

[0022] A system may be provided that includes at least one hardware processor configured to perform one or more of the methods described herein. A computer-readable storage medium may also be provided that stores a program of machine-executable instructions for performing one or more of the methods described herein.

[0023] Further features, as well as the structure and operation of various embodiments, are described in detail below with reference to the accompanying drawings, where like reference numbers indicate identical or functionally similar elements. [Brief explanation of the drawings]

[0024] [Figure 1] FIG. 1 illustrates components of a system for program migration in one embodiment. [Figure 2] FIG. 1 illustrates an overview of program migration in one embodiment. [Figure 3] FIG. 1 illustrates a method for program migration in one embodiment. [Figure 4] FIG. 1 is a flow diagram illustrating a method for program migration in one embodiment. [Figure 5] FIG. 10 is another flow diagram illustrating a method for program migration in one embodiment. [Figure 6] FIG. 1 illustrates components of a system in one embodiment in which program migration can be performed. [Figure 7] FIG. 1 is a schematic diagram of an exemplary computer or processing system that may implement a system according to one embodiment. [Figure 8] FIG. 1 illustrates a cloud computing environment in one embodiment. [Figure 9] FIG. 1 illustrates a set of functional abstraction layers provided by a cloud computing environment in one embodiment of the present disclosure. DETAILED DESCRIPTION OF THE INVENTION

[0025] Transferring the context of a program's execution to a different computing environment is called migration, and it involves a checkpointing step to save the context. Checkpointing is the act of stopping a program's execution and allowing it to be resumed later by dumping its context to a file. Checkpointing is used for live migration of a program to a different machine, for example, to allow core routines to run on a computer with greater processing power or more specialized resources. The live migration process may begin by stopping the process just before the migration begins, saving its execution context to a file, transferring that file over a network to the new host computer, restoring it on the new host, and continuing execution from where it stopped. However, depending on the state of the process, the size of the checkpoint can be very large, and the transfer over the network can take a long time to complete.

[0026] In one or more embodiments, systems and methods for program migration can be provided. In one aspect, the systems and methods can address the problem of code migration, for example, by identifying code fragments to be migrated to a different computing environment and migrating those code fragments in a cost-effective manner.

[0027] The system may include, for example, computer-implemented components implemented on, operating on, or coupled with, one or more hardware processors. The one or more hardware processors may include, for example, components such as programmable logic devices, microcontrollers, memory devices, or other hardware components, or combinations thereof, that may be configured to perform the respective tasks described in this disclosure. The associated memory devices may be configured to selectively store instructions executable by the one or more hardware processors. The processor may be a central processing unit (CPU), a graphics processing unit (GPU), a field programmable gate array (FPGA), an application-specific integrated circuit (ASIC), or other suitable processing component or device, or one or more combinations thereof. The processor may be coupled to a memory device. The memory device may include random access memory (RAM), read-only memory (ROM), or other memory device and may store data and / or processor instructions for implementing various functions associated with the methods and / or systems described herein. The processor may execute computer instructions stored in memory or received from other computer devices or media. The methods may include, for example, computer-implemented methods implemented or operating on one or more processors.

[0028] In one embodiment, the system and / or method may identify one or more portions of code or a program for which checkpoints may be saved to enable program context migration to another computing environment. For example, the system may identify one or more portions of code within an interactive computing notebook or document. Examples of such interactive computing notebooks may include, but are not limited to, Jupyter Notebook and Wolfram Notebook. By way of example, an interactive computing notebook or similar may contain code, model execution, graphs, and additional documentation, e.g., a mix of text, code, and results, that can facilitate communication and collaboration and can be used to develop programs, such as data-driven models. These documents typically run on the user's machine or on a remote server. Furthermore, fragments of cells in a document may run on multiple platforms or machines. In one embodiment, the system and / or method may identify fragments to be migrated and enable migration in a cost-effective manner, for example, by identifying sweet spots for program context migration (e.g., for specialized resources) based on code pattern recognition and fragment characterization.

[0029] In one embodiment, in response to receiving a request to migrate a computer process to a remote host, the system and / or method may identify one or more checkpoints to migrate. In one embodiment, the system and / or method may consider the following aspects to identify which one or more checkpoints to migrate: (1) an estimate of the time it will take to transfer the checkpoint file to the remote host or other processor or machine (e.g., this may be a function of checkpoint file size and available network bandwidth), (2) the expected consumption of system resources to replay execution from checkpoint M to the final checkpoint N, (3) recognizing source code patterns to identify computationally expensive code portions (e.g., functions), (4) analyzing user interactivity with each fragment, and (5) the computational cost of migrating the program context and re-executing portions of the program.

[0030] In one embodiment, the system and / or method may also transform source code documentation to display or present data regarding migration costs so that a user can understand and approve the migration of program context. The system and method may provide benefits or advantages, for example, of reducing the time and resource consumption of computer tasks running on one or more processors that may be executed in multiple environments (e.g., specialized resources with GPUs and standard environments with CPUs).

[0031] FIG. 1 illustrates components of a system for program context migration in one embodiment. A user 102 may be a developer or other user who may interact with a user device 104 while developing code or programs using, for example, an interactive computing notebook or other programming tools. The user device 104 may be any computing device with which the user 102 may interact, such as a laptop, desktop, mobile device, such as a smartphone, tablet, or other device, or a combination thereof. The computing infrastructure 106 may include a group of computing resources capable of hosting the functionality described herein, such as providing a solution for program migration and operating a user program. For example, one or more loaded portions of a program may run on one computing infrastructure 106, while one or more other portions of the program may be migrated to another computing infrastructure to operate the overall program more efficiently. The solution or methodology for program context migration and the user program may run on the same or different computing infrastructures. The computing infrastructure 106 may be a cloud environment and / or a supercomputer. In one embodiment, the computing infrastructure 106 may also include user devices 104. For example, user programs may run on the user devices 104, the computing infrastructure 106, or both.

[0032] A function or module for identifying sweet spots for program context transitions, such as for an interactive computing notebook or other programming tool, may include a fragment and interactivity characterizer 108, a checkpoint spot identifier 110, a context transition manager 112, and a source code document corrector 114. The fragment and interactivity characterizer 108 may be responsible for identifying code patterns and levels of interactivity for fragments. The checkpoint spot identifier 110 may be responsible for identifying appropriate spots for saving checkpoints in preparation for program context transitions. The context transition manager 112 may be responsible for migrating a context to a different computing infrastructure (or the like but with different computing resources). The source code document corrector 114 may be responsible for correcting a user's source code documentation, for example, so that the user can recognize and approve context transitions to different environments.

[0033] The system can identify spots for migration of a program to be executed on another computer, such as a specialized resource, based on recognizing code patterns and characterizing fragments in code documents, such as interactive computing notebooks. The system can recognize source code patterns to identify one or more code portions (e.g., functions) that are candidates for migration, such as portions that are computationally expensive or have frequent interactivity. For example, the system can utilize techniques such as abstract syntax trees, deep learning, and machine learning, such as k-nearest neighbors, kernel regression, linear regression, or other techniques, or combinations thereof, to identify candidate code fragments for migration to specialized resources. In one embodiment, normalized code execution times from existing code documents can be used as features to train a machine learning model that can classify or identify candidate fragments. The system can also analyze user interactivity with each fragment, the computational cost of migrating program context, and re-executing portions of the program. The system can also transform source code documents with information data or metadata related to migration costs so that users can choose to perform migration or program context migration.

[0034] FIG. 2 illustrates an overview of program migration in one embodiment. The illustrated components may be implemented, performed, or run on one or more computer processors, such as hardware processors, or a combination thereof. The diagram illustrates the identification of spots for program context migration to execute portions of a program, such as with specialized resources, based on code pattern recognition and fragment characterization for interactive computing, such as in an interactive code development environment or platform. An interactive document or programming environment 202 may include fragments or cells 204, 206, and 208 containing lines of code. The interactive document 202 may run on a computer or machine, and fragments may be loaded and run on a processor (e.g., referred to as a first processor). A user 210 may load lines of code as fragments or cells into an interactive computing notebook or similar platform, for example, via an interface or user interface on a computing device (e.g., that of the development platform). A fragment analyzer 212 or computer processor analyzes the contents of the loaded fragments 204, 206, and 208 to determine one or more candidate fragments for migration. For example, the components shown at 108 in FIG.

[0035] In one embodiment, to select candidate fragments, fragment analyzer 212 may consider the computational intensity of the fragment, the user interactivity with the fragment, and / or other factors. For example, certain code may involve more computation, which may require more computing power to run within a feasible or desired time. Other fragments may involve more interactivity with the user, such as repetitions or loops, and may benefit from running on a machine with more power or resources than the current machine (e.g., the first processor).

[0036] Fragments 204, 206, and 208 illustrate examples of loaded fragments within a program loaded into an interactive development platform, such as an interactive computing notebook. Fragment analyzer 212 analyzes fragment 204. This exemplary fragment includes lines of code that load data or prepare data for processing. Fragment analyzer 212 determines that such data loading or data preparation processing would not require a more powerful or specialized machine to run, and determines or recommends that fragment 204 can run locally on the current machine (e.g., the first processor), e.g., on the CPU. Fragment analyzer 212 also analyzes fragment 206. This exemplary fragment includes lines of code that train a machine learning model. The fragment analyzer 212 determines that training a machine learning model, e.g., training an artificial neural network (e.g., which may include, but is not limited to, updating weights using matrix and / or vector operations and learning methods such as gradient descent), may be computationally intensive and expensive and may benefit from running on a machine with greater power and / or resources, e.g., a specialized processor such as a GPU or FPGA, a supercomputer, or other machine, and determines that the fragment at 206 may be a candidate for remote (or other) execution. The fragment analyzer 212 may tag the fragment as a candidate. The fragment analyzer 212 further analyzes the fragment at 208. This exemplary fragment includes running the trained machine learning model to, e.g., make predictions and also plot the results. Such a fragment may include iterations, such as fine-tuning in a trial-and-error loop.Fragment analyzer 212 determines that such code would benefit from running on a machine with more computational power and / or resources, e.g., a specialized processor such as a GPU or FPGA, a supercomputer, or other machine, and may tag this fragment as a candidate.

[0037] In one embodiment, fragment analyzer 212 determines or selects candidate fragments for migration to another machine based on or using existing code stored, for example, in a database or other data store. For example, a database may store existing code with identifiers or tags that identify or tag it as computationally expensive or computationally intensive, as having interactive patterns, etc. For example, database 214 may store code or lines of code determined or known to be computationally expensive, such as code for training a model, performing a fast Fourier transform, ray tracing, or other, or a combination thereof. Database 216 may store code or lines of code determined or known to have interactive patterns, such as code that runs a predictive model followed by a plot or print, or other, or a combination thereof. Fragment analyzer 212 may search databases 214, 216 for code with similar characteristics to the current code being analyzed, e.g., 204, 206, 208, and identify fragments as candidates for migration based on similarity. Whether code is similar to other code may be determined based on a similarity threshold. Determining similarity may also involve contrasting or comparing metadata or attributes associated with lines of code within the current fragment with those of existing code stored in a database.

[0038] In other embodiments, a machine learning model can be trained to predict whether a fragment contains code that may be a candidate for migration. For example, attributes of existing code (e.g., which may be stored in database 214) determined to be computationally expensive can be used as features in training a neural network model, a deep learning model, or other machine learning model, or a combination thereof, to predict or classify whether a given piece of code is computationally expensive. For example, by inputting attributes of the current code (or given code) as features when running such a trained machine learning model, the trained machine learning model can predict or classify whether the given piece of code is computationally expensive. Similarly, attributes of existing code (e.g., which may be stored in database 216) determined to have an interactive pattern can be used as features in training a neural network model, a deep learning model, or other machine learning model, or a combination thereof, to predict or classify whether a given piece of code contains an interactive pattern. For example, by inputting attributes of the current code (or given code) as features into such a trained machine learning model, the trained machine learning model can predict whether the given code has an interactive pattern. Other known or hereafter known techniques can be used to determine whether a particular code fragment contains computationally expensive code, has an interactive pattern, or both.

[0039] Based on identifying one or more candidate fragments, one or more locations for injecting code to save a checkpoint can be determined, which may be, for example, immediately before the candidate fragment to be migrated. By way of example, a checkpoint spotting identifier shown at 110 in FIG. 1 may perform this function. Because checkpointing saves the program execution context to a file, that file may be transferred along with the migrated fragment so that the migrated fragment continues to run on the destination machine.

[0040] The processor may automatically modify one or more fragments of the loaded program. For example, the source code document modifier shown at 114 in FIG. 1 may perform this function. For example, one or more fragments or cells of the interactive document shown at 202 may be modified as shown at 218 and 220, 222, and 224. For example, the processor may inject code to save a checkpoint into fragment 220, which operates immediately before candidate fragment 222, to preserve the program context up to the point before operating the migrated component.

[0041] The processor may further modify the fragment 220, for example, by injecting code to indicate information such as the size of the checkpoint, the execution time of the fragment, or other information, or a combination thereof, that may be useful to a user in determining or approving whether or which fragment to migrate. The candidate fragments 222, 224 may also be modified to display user interface icons or similar graphical elements 226, 228 that can be activated. Activating the graphical element (e.g., pressing or clicking the graphical icon or button) migrates the fragment to another processor or machine, for example, a remote host 230 or another local machine (e.g., referred to as a second processor). A context migration manager, shown as 112 in FIG. 1, may perform the function of migrating from the first processor to the second processor. The remote host 230 may be, for example, a supercomputer or other computer with greater processing power or resources than the machine on which the fragment was originally loaded. The remote host 230 restores the program context, for example, from a checkpoint, and executes the migrated fragment. The checkpoint can be updated based on running the migrated fragment. The remote host 230 can save the updated checkpoint. The updated checkpoint can be returned to the local machine so that, for example, subsequent fragments can continue running on the local machine using the updated checkpoint. In other aspects, the migration need not be to a remote machine. For example, a fragment can be migrated from a CPU to a specialized processor, such as a GPU or FPGA, on the local machine.

[0042] 3 illustrates a method for program migration in one embodiment. At 304, a collection of code fragments 302 is loaded into an interactive development platform. For example, a user may load a collection of code fragments into an interactive computing notebook such as Jupyter Notebook. In one aspect, a code fragment may be characterized as a single contiguous block of code (represented by a single execution cell) or may be divided into smaller portions (cells) according to some user-establishable criteria.

[0043] In one embodiment, at 306, before executing or operating any cell, a code analyzer or fragment analyzer or computer processor, for example, checks the contents of cells loaded into the platform against a database 308 of code fragments known to be computationally intensive. Cells with code fragments similar to those characterized in the database 308 can be considered candidates for migration to run on a remote host 328 or other processor or device with greater processing power or other specialized resources, such as an FPGA or GPU. At 312, the fragment analyzer or computer processor identifies one or more candidate fragments for migration. The fragment analyzer at 306 may determine or calculate the similarity between the code fragments using any known or hereafter known method, including, but not limited to, attribute or metadata comparison, bitmap comparison, or the like, or a combination thereof. Similarity may be determined based on the degree of similarity meeting a similarity threshold.

[0044] In one embodiment, database 308 contains historical or existing code fragments. For example, database 308 can be populated by scanning a public repository of an interactive notebook or similar development platform, retrieving information such as: (1) metadata indicating the time it took each cell to execute; and (2) metadata indicating the number of times a given cell has been executed by a user. The metadata indicating the time it took each cell to execute can be used to identify patterns of code fragments that take longer to execute than a predetermined threshold (e.g., as shown at 314). The metadata indicating the number of times a given cell has been executed by a user can indicate patterns of code fragments that frequently run in a "tune parameters and run again" type of loop and whose execution times exceed other thresholds (e.g., as shown at 316). This component evaluates user interactivity with those fragments.

[0045] In one embodiment, the method may leverage external sources for fragment analysis, such as at 306. For example, an existing document may be retrieved. The user document may be compared to the existing document for similarity using one or more techniques, such as, for example, an abstract syntax tree (AST) and deep learning. Closer or similar candidates may be selected based on a similarity index and a similarity threshold, which may be adjustable based on, for example, dataset size and resource availability. In one embodiment, the duration of the user document fragments may be estimated by (i) using AST features as features for a training model and (ii) using the execution times of the candidate's existing fragments as labels for a regression (e.g., neural net, kernel regression, or other, or a combination thereof). The method may incorporate multiplication factors or weights for the user document fragments based on detected interactivity between the user and the document.

[0046] Once candidate fragments for migration are identified at 318, the computer processor injects code into one or more cells such that a checkpoint is taken immediately before the candidate fragments are executed or run. Checkpointing involves capturing the state of a process, e.g., local variables and their values, and saving that state (also called a program context). For example, the state can be saved to a checkpoint database 320. In one embodiment, code for migration can be prepared as follows: The computer processor can retrieve from the database 320 the code to be injected, e.g., code for committing the state to the checkpoint database 320 and code for performing the fragment migration. The database 320 can also include the address of a remote host or other processor where the fragment should be executed. This address can also be retrieved. The database 320 can further include specifications or instructions on how the code should be injected, e.g., before or after the original code, or by replacing the original code with a specific modification. Such specifications or instructions can also be retrieved. Code injection can be performed according to the retrieved information.

[0047] At 322, the computer processor or migration manager decorates the cell of each candidate fragment for migration. Such decoration may include, but is not limited to, (1) the size of the checkpoint to be transferred to the remote host or other processor, (2) an estimate of the time to transfer the checkpoint to the remote host, (3) an estimate of the time to run the code fragment on the remote host or other processor, and (4) an estimate of the amount of time saved by running the code fragment on the remote host compared to running it locally. Decoration may also include an interactive graphical element or icon (e.g., a button) that allows a user to interactively control whether to allow or disallow migration because, for example, there may be costs associated with data transfer and remote resource usage.

[0048] In one embodiment, a program with several migration candidates may have multiple points at which checkpoints are taken. In one aspect, because programs tend to generate more data in memory as they operate, the very first checkpoint may likely be smaller in size than the last checkpoint. In one embodiment, the specific decision made by the computer processor or migration manager function when applying cell decoration at 322 is which of the last N checkpoints to migrate to a remote host (or other processor) in case the user chooses to run the fragment elsewhere. In one embodiment, the decision is made based on the size of each checkpoint versus the time it took to execute the remaining cells (up to the current cell holding the fragment to be migrated). For example, uploading a checkpoint from cell N-2 and recomputing cell N-1 on the remote host may be faster than uploading a much larger checkpoint at N-1. For example, in this case, cell N can be run on the remote host by also migrating cell N-1 and running it again on the remote host.

[0049] At 324, it is determined whether the candidate fragment should be migrated to run on another processor, such as a remote host. For example, a user may activate an adornment (e.g., a graphical element) associated with the candidate fragment to indicate that the candidate fragment should run on another processor or remote host. At 326, in response to determining that the candidate fragment should run on another processor or remote host, the candidate fragment is migrated to the other processor or remote host 328. The saved checkpoint may also be migrated based on one or more criteria, for example, whether it is cost-effective to transfer the saved checkpoint. If at 324 it is determined that the candidate fragment should not run on another processor or remote host, the method may return or terminate.

[0050] At 326, a live migration component or similar functionality operating on the computer processor performs the migration to another processor, such as a remote host 328. For example, a computer processor operating the live migration functionality pauses execution of a program (loaded on an interactive platform) and migrates selected checkpoints and candidate fragments from database 320 to the remote host 328. The remote host 328 loads the candidate fragment and checkpoint data into its own fragment processor, such as 330, and executes from the checkpoint to the last line of code in the candidate fragment that was migrated to its machine.

[0051] Once the candidate fragment completes operation on the remote host 328, the checkpoint 332 captured on the remote host 328 can be transferred to the checkpoint database 320. For example, the candidate fragment may be injected with code to save the checkpoint. In one embodiment, a signal can be sent to the original machine that initiated the migration. For example, at 334, the computer processor of the original machine loads the checkpoint into its interactive computation engine and resumes program execution. In one embodiment, for example, incremental differences between checkpoints can be stored or saved in the database 320 rather than saving a complete dump at each checkpoint. In this manner, transmission bandwidth and memory space can be saved. Known or hereafter known techniques can be utilized for saving checkpoints and / or different methods of storing checkpoints.

[0052] In one embodiment, the methodology disclosed herein can be implemented as an add-on, hook, or service added to an interactive platform, such as an interactive computing notebook. In one embodiment, the interactive platform can be accessed via a browser, such as a World Wide Web (web) browser, over a network, such as the Internet. An example use case is described below. The interactive computing notebook may have several processing machines available to run computer processes or programs. As an example, consider a case where a CPU and a GPU are available as resources for the interactive computing notebook to run a program. A user may load fragments or cells of a program into the interactive computing notebook. Consider a case where all fragments are initially loaded to run on the CPU. The methodology disclosed herein can analyze the fragments and determine which fragments would benefit from running on the GPU, e.g., transitioning from the CPU to the GPU for operation. For example, the methodology can determine the appropriate computing environment (e.g., CPU or GPU in this example) for a particular fragment or cell based on context-awareness. The methodology can then perform context transition of the code fragment to the appropriate environment and seamlessly dispatch computation there.

[0053] In this exemplary use case, a user may begin writing or developing code using an interactive computing notebook, for example, as one or more fragments or cells. The cells may not yet be running, and resources may be idle. The first cell begins execution, and a processor, such as a CPU, is used because, for example, the methodology determines that a CPU is an appropriate resource for running this cell. The first cell finishes execution. The methodology may send the user an explanation of why the CPU was used in this cell. For example, the methodology may indicate to the user that this cell contains data preparation code and that, among available resources, a CPU is appropriate for running this type of task. Based on the determination that the next cell is appropriate for running on another, more powerful resource (e.g., the next cell contains code for training a machine learning model), the methodology may seamlessly perform a live context transition of the user's session from the CPU to another available computing resource, such as a GPU. The user is about to run the next cell. At this stage, the GPU is idle. At this stage, the kernel running on the machine associated with the GPU already has a user session that was previously running on the CPU, e.g., due to seamless live context migration of code fragments. The user executes the next cell. The next cell, e.g., the training of a machine learning model, finishes. The methodology may present an explanation of where and why this cell was executed or run. For example, data such as execution time on the GPU and an explanation that the cell contained machine learning or training code may be provided to the user, e.g., via a user interface in an interactive computing notebook. While the above exemplary use cases are described with reference to CPUs and GPUs as example source and target machines or processors in code migration, it should be understood that other types of source and target machines may be applicable to the methodology disclosed herein.

[0054] 4 is a flow diagram illustrating a method for program migration in one embodiment. The method may be implemented on or run by a computer processor. At 402, a collection of code fragments is received. For example, the code fragments may be loaded into an interactive development platform for execution on a first processor. An example of an interactive development platform may be an interactive computing notebook.

[0055] At 404, candidate fragments within the collection of code fragments for migration to a second processor are determined. In one embodiment, the second processor has greater computational power or more resources than the first processor. In one embodiment, such determination may be made based on characterizing the collection of code fragments. Characterizing the collection of code fragments may include determining the computational intensity of each fragment within the collection of code fragments. In one embodiment, the computational intensity may be determined based on using known computationally intensive code fragments. In one embodiment, the computational intensity may be determined based on training a machine learning model to predict the computational intensity of the fragment based on known computationally intensive code fragments. In one embodiment, the computational intensity may be determined based on the operation time of the code fragment and an interactive pattern associated with the code fragment.

[0056] At 406, a spot within the collection of code fragments for injecting code for saving program context, such as checkpointing, is identified based on the location of the candidate fragment within the collection of code fragments.

[0057] At 408, code for saving the program context is injected into the identified spot. The identified spot may be within a fragment that runs immediately before the candidate fragment, e.g., at the end of the fragment. The fragment may be further modified to present or display data or metadata about the fragment, such as, for example, the size of the program context, the execution time of the fragment, etc. In one embodiment, the candidate fragment may also be modified. For example, an interactive graphical element depicting the candidate fragment may be added to a user interface window of the interactive development platform. The interactive graphical element may provide a user with the option to migrate the candidate fragment to run on a second processor. As another example, the candidate fragment may be modified to present or display data or metadata, e.g., savings or computational efficiencies, associated with running the candidate fragment on a faster or more powerful processor.

[0058] At 410, in response to the code for saving the program context running on the first processor, the program context is migrated to the second processor based on criteria. The criteria may include comparing the size of the program context to a predefined or configurable threshold. For example, if the program context is large, it may be inefficient to transfer a large file to another machine. Other criteria may include the execution time or processing time required to run the fragment that generated the program context. For example, if the cost of transferring the program context to the second processor is less cost-effective than running the fragment on the second processor and generating the program context on the second processor, the fragment may be migrated instead of the program context. In one embodiment, a candidate fragment may also be migrated to the second processor if, for example, the second processor does not already have the fragment.

[0059] In one embodiment, the method may also include receiving from the second processor an updated program context generated in response to the candidate fragments being executed on the second processor. In one embodiment, the method may also include continuing to execute the collection of code fragments on the first processor.

[0060] 5 is another flow diagram illustrating a method for program migration in one embodiment. The method may be implemented on or run by a computer processor. At 502, a code fragment is received to be loaded into an interactive development platform for execution on a first processor.

[0061] At 504, candidate fragments for migration from the code fragments to the second processor are determined based on determining the computational intensity associated with each of the code fragments. There may be multiple candidate fragments. In one embodiment, the computational intensity may be determined based on an operation time of the code fragment and an interactive pattern associated with the code fragment.

[0062] At 506, a spot within the code fragment for saving the program context is identified. There may be multiple spots. At 508, computer instructions for saving the program context are injected into the identified spot. At 510, in response to the computer instructions for saving the program context running on the first processor, the method may include determining whether it is more cost-effective to migrate the program context or the code fragment that generated the program context. In one embodiment, whether it is more cost-effective to migrate the program context or the code fragment that generated the program context may be determined based on the size of the program context and the processing time required to run the code fragment that generated the program context. For example, it may be more cost-effective to run the code fragment that generated the program context on the second processor than to transfer the program context to the second processor.

[0063] At 512, in response to determining that it is more cost-effective to migrate the program context, the program context is migrated to the second processor. At 514, in response to determining that it is more cost-effective to migrate the code fragment that generated the program context, the code fragment that generated the program context is migrated to the second processor, so that, for example, the code fragment can be run on the second processor and subsequently the candidate fragment can be run on the second processor. The method may also include waiting for the second processor to run the candidate fragment and receiving an updated program context associated with running the candidate fragment.

[0064] FIG. 6 illustrates components of a system in one embodiment that can perform program migration. One or more hardware processors 602, such as a central processing unit (CPU), a graphics processing unit (GPU), and / or a field programmable gate array (FPGA), an application-specific integrated circuit (ASIC), and / or other processors, are coupled with a memory device 604 to perform the program migration described herein. The memory device 604 may include random access memory (RAM), read-only memory (ROM), or other memory devices and may store data and / or processor instructions for implementing various functions associated with the methods and / or systems described herein. The one or more processors 602 may execute computer instructions stored in the memory 604 or received from other computer devices or media. The memory device 604 may store, for example, instructions and / or data for the one or more hardware processors 602 to function and may include an operating system and other programs of instructions and / or data. One or more hardware processors 602 may receive input including a collection of code fragments to be loaded into an interactive development platform, such as an interactive computing notebook. At least one hardware processor 602 may determine one or more candidate fragments for migration to run on a different processor, such as a GPU, FPGA, or other processor, or on a different host machine, such as a remote host. The different or other processor may, for example, have greater computing power and may run one or more candidate fragments faster than the current processor or machine. At least one hardware processor 602 may identify a spot or location within the collection of fragments to inject code to save program context. For example, the spot or location may be immediately before the candidate fragment.At least one hardware processor 602 may inject code for saving program context into the identified spot. In response to the code for saving program context running on the first processor, the program context may be migrated to a second processor, for example, based on criteria. The second processor may be a GPU, FPGA, or other device on the same machine. In other aspects, the second processor may be a processor on a remote host 612, such as a supercomputer. In one aspect, the program context may be stored in the storage device 606 or in another storage device on a remote device connected via a network interface 608. Code fragments may be temporarily loaded into the memory device 604, for example, for execution by one or more hardware processors 602. The one or more hardware processors 602 may be coupled to an interface device, such as a network interface 608 for communicating with remote systems over a network, for example, and an input / output interface 610 for communicating with input and / or output devices, such as a keyboard, mouse, display, or other, or combination thereof.

[0065] Figure 7 illustrates a schematic diagram of an exemplary computer or processing system on which a system in one embodiment may be implemented. The computer system is merely one example of a suitable processing system and is not intended to suggest any limitation as to the scope of use or functionality of the methodology embodiments described herein. The illustrated processing system may operate with numerous other general-purpose or special-purpose computing system environments or configurations. Examples of well-known computing systems, environments, or configurations, or combinations thereof, that may be suitable for use with the processing system illustrated in Figure 7 may include, but are not limited to, personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputer systems, mainframe computer systems, and distributed cloud computing environments that include any of the above systems or devices.

[0066] A computer system may be described in the general context of computer system-executable instructions, such as program modules, that are run by the computer system. Generally, program modules may include routines, programs, objects, components, logic, data structures, etc. that perform particular tasks or implement particular abstract data types. The computer system may also be practiced in distributed cloud computing environments where tasks are performed by remote processing devices linked through a communications network. In a distributed cloud computing environment, program modules may be located in both local and remote computer system storage media, including memory storage devices.

[0067] The components of the computer system may include, but are not limited to, one or more processors or processing units 12, a system memory 16, and a bus 14 that couples various system components, including the system memory 16, to the processor 12. The processor 12 may include modules 30 that implement methods described herein. The modules 30 may be programmed into integrated circuits of the processor 12 or may be loaded from the memory 16, the storage device 18, or the network 24, or a combination thereof.

[0068] Bus 14 may represent any one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures, including, by way of example and not limitation, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, an Enhanced ISA (EISA) bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.

[0069] The computer system may include a variety of computer system readable media, which may be any available media that can be accessed by the computer system and may include both volatile and nonvolatile media, removable and non-removable media.

[0070] System memory 16 may include computer system-readable media in the form of volatile memory, such as random access memory (RAM) and / or cache memory, or the like. The computer system may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 18 may be provided for reading from and writing to non-removable, non-volatile magnetic media (e.g., a "hard drive"). Although not shown, a magnetic disk drive may be provided for reading from and writing to removable, non-volatile magnetic disks (e.g., a "floppy disk"), and an optical disk drive may be provided for reading from and writing to removable, non-volatile optical disks, such as CD-ROMs, DVD-ROMs, or other optical media. In such an example, each may be connected to bus 14 by one or more data media interfaces.

[0071] The computer system may also communicate with one or more external devices 26, such as a keyboard, pointing device, display 28, one or more devices that allow a user to interact with the computer system, or any device that allows the computer system to communicate with one or more other computing devices (e.g., network cards, modems, etc.), or combinations thereof. Such communication may occur via an input / output (I / O) interface 20.

[0072] Furthermore, the computer system can communicate with one or more networks 24, such as a local area network (LAN), a general wide area network (WAN), or a public network (e.g., the Internet), or a combination thereof, via a network adapter 22. As shown, the network adapter 22 communicates with other components of the computer system via a bus 14. It should be understood that other hardware and / or software components, not shown, can be used with the computer system. Examples include, but are not limited to, microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data archive storage systems.

[0073] While this disclosure may include detailed descriptions of cloud computing, it should be understood in advance that implementation of the teachings recited herein is not limited to a cloud computing environment. Rather, embodiments of the present invention may be implemented in conjunction with any other type of computing environment, now known or later developed. Cloud computing is a service delivery model that enables convenient, on-demand network access to a shared pool of configurable computing resources (e.g., networks, network bandwidth, servers, processing, memory, storage, applications, virtual machines, and services) that can be rapidly provisioned and released with minimal administrative effort or interaction with a service provider. This cloud model may include at least five characteristics, at least three service models, and at least four deployment models.

[0074] The features are as follows:

[0075] On-Demand Self-Service: Cloud consumers can unilaterally provision computing capacity, such as server time and network storage, automatically as needed, without requiring human interaction with the provider of the service.

[0076] Broad Network Access: Capabilities are available over the network and are accessed through standard mechanisms that facilitate use by heterogeneous thin or thick client platforms (e.g., mobile phones, laptops, and PDAs).

[0077] Resource Pooling: Pooling a provider's computing resources to serve multiple consumers using a multi-tenant model where various physical and virtual resources are dynamically allocated and reallocated according to demand. The consumer generally has no control over or knowledge of the exact location of the resources provided, although there is a sense of location independence in that the location may be identifiable at a higher level of abstraction (e.g., country, state, or data center).

[0078] Rapid Elasticity: Capacity can be rapidly and elastically provisioned, sometimes automatically, to quickly scale out and rapidly release to quickly scale in. To the consumer, provisionable capacity often appears unlimited and can be purchased in any quantity at any time.

[0079] Metered Services: Cloud systems automatically control and optimize resource usage by leveraging metering capabilities at a level of abstraction appropriate to the type of service (e.g., storage, processing, bandwidth, and active user accounts). Resource usage can be monitored, managed, and reported to provide transparency to both providers and consumers of utilized services.

[0080] The service model is as follows:

[0081] Software as a Service (SaaS): The consumer is offered the ability to use a provider's applications running on a cloud infrastructure. The applications are accessible from a variety of client devices through thin-client interfaces such as web browsers (e.g., web-based email). The consumer does not manage or control the underlying cloud infrastructure, including networks, servers, operating systems, storage, or even individual application features, with the possible exception of limited user-specific application configuration settings.

[0082] Platform as a Service (PaaS): The ability offered to consumers is to deploy applications they create or acquire, written using programming languages ​​and tools supported by the provider, onto a cloud infrastructure. The consumer does not manage or control the underlying cloud infrastructure, including the network, servers, operating systems, or storage, but does control the deployed applications and, in some cases, the application hosting environment configuration.

[0083] Infrastructure as a Service (IaaS): The ability offered to consumers is to provision processing, storage, network, and other basic computing resources onto which they can deploy and run any software, which can include operating systems and applications. Consumers do not manage or control the underlying cloud infrastructure, but they do control the operating systems, storage, deployed applications, and possibly limited control over selected networking components (e.g., host firewalls).

[0084] The deployment model is as follows:

[0085] Private Cloud: Cloud infrastructure is operated exclusively for an organization. It can be managed by the organization or a third party and can reside on-premise or off-premise.

[0086] Community Cloud: Cloud infrastructure is shared by several organizations to support a specific community with common concerns (e.g., mission, security requirements, policies, and compliance considerations). It may be managed by the organization or a third party and may reside on-premise or off-premise.

[0087] Public Cloud: Cloud infrastructure is made available to the general public or large industry groups and is owned by an organization that sells cloud services.

[0088] Hybrid Cloud: A cloud infrastructure is a composite of two or more clouds (private, community, or public) that remain unique entities but are joined by standardized or proprietary technologies that allow for data and application portability (e.g., cloud bursting for load balancing between clouds).

[0089] Cloud computing environments are service-oriented with an emphasis on statelessness, low coupling, modularity, and semantic interoperability. At the core of cloud computing is an infrastructure that includes a network of interconnected nodes.

[0090] Referring now to FIG. 8, an exemplary cloud computing environment 50 is shown. As shown, the cloud computing environment 50 includes one or more cloud computing nodes 10, with which local computing devices used by cloud consumers, such as, for example, a personal digital assistant (PDA) or mobile phone 54A, a desktop computer 54B, a laptop computer 54C, or an automobile computer system 54N, or any combination thereof, may communicate. The nodes 10 may communicate with each other. They may be grouped physically or virtually in one or more networks (not shown), such as, for example, the private, community, public, or hybrid clouds described above, or any combination thereof. This enables the cloud computing environment 50 to provide infrastructure-as-a-service, platform-as-a-service, or software-as-a-service services, or any combination thereof, without requiring cloud consumers to maintain resources on their local computing devices. It should be understood that the types of computing devices 54A-N shown in FIG. 8 are intended to be exemplary only, and that computing node 10 and cloud computing environment 50 can communicate with any type of computerized device over any type of network and / or network-addressable connection (e.g., using a web browser).

[0091] Referring now to Figure 9, a set of functional abstraction layers provided by cloud computing environment 50 (Figure 8) is shown. It should be understood in advance that the components, layers, and functions shown in Figure 9 are intended to be exemplary only, and embodiments of the present invention are not limited thereto. As shown, the following layers and corresponding functions are provided:

[0092] Hardware and software layer 60 includes hardware and software components. Examples of hardware components include mainframe 61, RISC (Reduced Instruction Set Computer) architecture-based servers 62, servers 63, blade servers 64, storage devices 65, and networks and networking components 66. In some embodiments, software components include network application server software 67 and database software 68.

[0093] The virtualization layer 70 provides an abstraction layer from which the following examples of virtual entities may be provided: virtual servers 71, virtual storage 72, virtual networks including virtual private networks 73, virtual applications and operating systems 74, and virtual clients 75.

[0094] In one example, the management layer 80 may provide the following functions: Resource provisioning 81 provides dynamic procurement of computing and other resources utilized to perform tasks within the cloud computing environment. Metering and pricing 82 provides cost tracking as resources are utilized within the cloud computing environment and accounting or billing for the consumption of these resources. In one example, these resources may include application software licenses. Security provides identity verification for cloud consumers and tasks, as well as protection for data and other resources. User portal 83 provides consumers and system administrators with access to the cloud computing environment. Service level management 84 provides allocation and management of cloud computing resources so that requested service levels are met. Service level agreement (SLA) planning and fulfillment 85 provides advance arrangement and procurement of cloud computing resources anticipated for future requests according to SLAs.

[0095] The workload layer 90 provides examples of functionality for which a cloud computing environment may be utilized. Examples of workloads and functions that may be provided from this layer include mapping and navigation 91, software development and lifecycle management 92, virtual classroom instruction delivery 93, data analytics processing 94, transaction processing 95, and program migration processing 96.

[0096] The present invention may be a system, method, or computer program product, or combination thereof, integrated at any possible level of technical detail. The computer program product may include a computer-readable storage medium (or media) having computer-readable program instructions thereon for causing a processor to practice aspects of the present invention.

[0097] A computer-readable storage medium may be any tangible device capable of retaining and storing instructions for use by an instruction-execution device. A computer-readable storage medium may be, for example, but not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. A non-exhaustive list of more specific examples of computer-readable storage media includes portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital versatile disk (DVD), Memory Stick®, floppy disk, mechanically encoded devices such as punch cards or grooved ridge structures having instructions recorded thereon, and any suitable combination thereof. Computer-readable storage medium, as used herein, should not be construed as a transitory signal per se, such as, for example, radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., light pulses passing through fiber optic cable), or electrical signals transmitted over wires.

[0098] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device or to an external computer or storage device over a network, such as the Internet, a local area network, a wide area network, or a wireless network, or a combination thereof. The network may include copper transmission cables, fiber optic transmission cables, wireless transmission cables, routers, firewalls, switches, gateway computers, or edge servers, or a combination thereof. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and transfers the computer-readable program instructions for storage in a computer-readable storage medium within the respective computing / processing device.

[0099] Computer-readable program instructions for carrying out the operations of the present invention may be source or object code written in any combination of one or more programming languages, including assembler instructions, instruction-set-architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state-setting data, integrated circuit configuration data, or object-oriented programming languages ​​such as Smalltalk®, C++, and procedural programming languages ​​such as the "C" programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the last scenario, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or a connection may be made to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry including, for example, a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be personalized by utilizing state information of the computer-readable program instructions to execute the computer-readable program instructions to implement aspects of the present invention.

[0100] Aspects of the present invention are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.

[0101] These computer-readable program instructions may be provided to a processor of a computer or other programmable data processing apparatus to produce a machine such that, when the instructions are executed by the processor of the computer or other programmable data processing apparatus, means are generated for implementing the functions / acts specified in one or more blocks of the flowcharts and / or block diagrams. These computer-readable program instructions may also be stored on a computer-readable storage medium capable of directing a computer, programmable data processing apparatus, or other device, or combination thereof, to function in a particular manner, such that the computer-readable storage medium on which the instructions are stored constitutes an article of manufacture including instructions that implement aspects of the functions / acts specified in one or more blocks of the flowcharts and / or block diagrams.

[0102] Furthermore, computer-readable program instructions may be loaded into a computer, other programmable data processing apparatus, or other device to cause the computer, other programmable apparatus, or other device to perform a series of operational steps, thereby generating a computer-implemented process that, when executed on the computer, other programmable apparatus, or other device, implements the functions / acts specified in one or more blocks of the flowcharts and / or block diagrams.

[0103] The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowcharts or block diagrams may represent a module, segment, or portion of instructions, including one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the blocks may occur out of the order depicted. For example, depending on the functionality involved, two blocks shown in succession may actually be realized as a single step, may operate concurrently, substantially concurrently, partially, or completely overlapping in time, or the blocks may even operate in the reverse order. It will also be noted that each block in the block diagrams and / or flowchart diagrams, and combinations of blocks in the block diagrams and / or flowchart diagrams, may be implemented by a dedicated hardware-based system that performs the specified functions or acts or practices a combination of dedicated hardware and computer instructions.

[0104] The terms used herein are for the purpose of describing particular embodiments only and are not intended to be limiting of the present invention. As used herein, the singular forms "a," "an," and "the" are intended to include the plural unless the context dictates otherwise. As used herein, the term "or" is an inclusive operator and can mean "and / or" unless the context explicitly or clearly dictates otherwise. As used herein, the terms "comprise," "comprises," "comprising," "include," "includes," "including," or "having," or combinations thereof, may indicate the presence of stated features, integers, steps, operations, elements, or components, or combinations thereof, but it will be further understood that they do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, or groups thereof, or combinations thereof. As used herein, the phrase "in an embodiment" does not necessarily refer to the same embodiment, although it may. As used herein, the phrase "in one embodiment" does not necessarily refer to the same embodiment, although it may. As used herein, the phrase "in another embodiment" does not necessarily refer to a different embodiment, although it may. Furthermore, embodiments and / or elements of embodiments may be freely combined with each other unless they are mutually exclusive.

[0105] The corresponding structure, material, acts, and equivalents of all means or step-plus-function elements in the following claims, if any, are intended to include any structure, material, or acts for performing a function in combination with other claim elements as specifically claimed. The description of the present invention has been presented for purposes of illustration and description, but is not intended to be exhaustive or to limit the invention to the form disclosed. Many modifications and variations will be apparent to those skilled in the art without departing from the scope of the invention. The embodiments have been chosen and described in order to best explain the principles and practical applications of the invention and to enable those skilled in the art to appreciate the invention in various embodiments with various modifications suited to the particular uses contemplated.

Claims

1. receiving a collection of code fragments to be loaded into an interactive development platform for execution on a first processor; determining candidate fragments within the collection of code fragments for migration to a second processor based on characterizing the collection of code fragments; identifying a spot within the collection of code fragments for injecting code for preserving program context based on a position of the candidate fragment within the collection of code fragments; injecting said code for preserving program context into said identified spot; migrate the program context to the second processor in response to the code for saving program context running on the first processor and based on criteria; 11. A computer-implemented method comprising:

2. The method of claim 1 , further comprising migrating the candidate fragments to the second processor.

3. receiving from the second processor an updated program context generated in response to the candidate fragment being executed on the second processor; continuing operation of the collection of code fragments on the first processor; The method of claim 1 further comprising:

4. The method of claim 1 , wherein the interactive development platform comprises an interactive computing notebook.

5. The method of claim 1 , wherein characterizing the collection of code fragments comprises determining a computational intensity of each fragment in the collection of code fragments.

6. The method of claim 5 , wherein the computational intensity is determined based on using known computationally intensive code fragments.

7. The method of claim 6 , wherein the computational intensity is determined based on training a machine learning model to predict computational intensity of a fragment based on the known computationally intensive code fragments.

8. The method of claim 5 , wherein the computational intensity is determined based on an operation time of a code fragment and an interactive pattern associated with the code fragment.

9. 2. The method of claim 1, further comprising adding an interactive graphical element showing the candidate fragment to a user interface window of the interactive development platform, the interactive graphical element providing a user with an option to migrate the candidate fragment to run on the second processor.

10. The method of claim 1 , wherein the criteria includes the size of the program context meeting a threshold.

11. The method of claim 1 , wherein the second processor has greater computing power than the first processor.

12. receiving a code fragment to be loaded into an interactive development platform for execution on a first processor; determining candidate fragments from the code fragments for migration to a second processor based on determining a computational intensity associated with each of the code fragments; identifying a spot within said code fragment for preserving program context; injecting computer instructions into the identified spots to preserve program context; responsive to the computer instructions for saving a program context being executed on the first processor, determining whether it is more cost-effective to migrate the program context or to migrate the code fragment that generated the program context; migrate the program context to the second processor in response to determining that it is cost effective to migrate the program context; responsive to determining that it is more cost effective to migrate the code fragment that generated the program context, migrating the code fragment that generated the program context to the second processor; 11. A computer-implemented method comprising:

13. 13. The method of claim 12, wherein determining whether it is more cost-effective to migrate the program context or the code fragment that created the program context is based on a size of the program context and a processing time to run the code fragment that created the program context.

14. 14. The method of claim 13, wherein a plurality of spots for saving program context within a plurality of code fragments are identified, the method further comprising choosing which checkpoints created at which of the plurality of spots to migrate based on a program context size of the checkpoint and a processing time of the code fragment that created the checkpoint.

15. The method of claim 12 , wherein the computational intensity is determined based on an operation time of a code fragment and an interactive pattern associated with the code fragment.

16. A computer program product for causing a computer to carry out the method according to any one of claims 1 to 15.

17. A computer-readable storage medium having the computer program of claim 16 recorded thereon.

18. a hardware processor; a memory device coupled to the hardware processor; A system comprising: The hardware processor comprises at least: receiving a code fragment to be loaded into an interactive development platform for execution on a first processor; determining candidate fragments from the code fragments for migration to a second processor based on determining a computational intensity associated with each of the code fragments; identifying a spot within said code fragment for preserving program context; injecting computer instructions into the identified spots to preserve program context; responsive to the computer instructions for saving a program context being executed on the first processor, determining whether it is more cost-effective to migrate the program context or to migrate the code fragment that generated the program context; migrate the program context to the second processor in response to determining that it is cost effective to migrate the program context; responsive to determining that it is more cost effective to migrate the code fragment that generated the program context, migrating the code fragment that generated the program context to the second processor; The system is configured to:

19. 20. The system of claim 18, wherein whether it is more cost-effective to migrate the program context or the code fragment that created the program context is determined based on a size of the program context and a processing time to run the code fragment that created the program context.

20. A plurality of spots for saving program context within a plurality of code fragments are identified, and the system determines which checkpoints created at which of the plurality of spots to migrate based on the program context of the checkpoints.

20. The system of claim 19, further comprising: choosing based on the size and processing time of the code fragment that created the checkpoint.

21. 20. The system of claim 18, wherein the computational intensity is determined based on an operation time of a code fragment and an interactive pattern associated with the code fragment.

Citation Information

Patent Citations

  • Method and system for offloading execution and resources of devices with networked resource constraints

    JP2006502457A

  • Software conversion program and computer system

    JP2011204209A

  • Leveraging offload programming model for local checkpoints

    JP2016115340A

  • Techniques for Offloading and Onloading Data to Processor / Coprocessor Configurations

    JP2018513463A