• Aucun résultat trouvé

Adaptive Request Scheduling for the I/O Forwarding Layer using Reinforcement Learning

N/A
N/A
Protected

Academic year: 2021

Partager "Adaptive Request Scheduling for the I/O Forwarding Layer using Reinforcement Learning"

Copied!
11
0
0

Texte intégral

(1)

HAL Id: hal-01994677

https://hal.inria.fr/hal-01994677v3

Submitted on 16 Oct 2019

HAL

is a multi-disciplinary open access archive for the deposit and dissemination of sci- entific research documents, whether they are pub- lished or not. The documents may come from teaching and research institutions in France or abroad, or from public or private research centers.

L’archive ouverte pluridisciplinaire

HAL, est

destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d’enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.

Adaptive Request Scheduling for the I/O Forwarding Layer using Reinforcement Learning

Jean Luca Bez, Francieli Zanon Boito, Ramon Nou, Alberto Miranda, Toni Cortes, Philippe Navaux

To cite this version:

Jean Luca Bez, Francieli Zanon Boito, Ramon Nou, Alberto Miranda, Toni Cortes, et al.. Adap-

tive Request Scheduling for the I/O Forwarding Layer using Reinforcement Learning. Future Gen-

eration Computer Systems, Elsevier, 2020, 112, pp.1156-1169. �10.1016/j.future.2020.05.005�. �hal-

01994677v3�

(2)

Adaptive Request Scheduling for the I/O

Forwarding Layer using Reinforcement Learning

Jean Luca Bez1,3, Francieli Zanon Boito2, Ramon Nou3, Alberto Miranda3, Toni Cortes3,4, Philippe Navaux1

1Institute of Informatics, Federal University of Rio Grande do Sul (UFRGS) — Porto Alegre, Brazil

2LaBRI, Universit´e de Bordeaux, Inria, CNRS, Bordeaux-INP — Bordeaux, France

3Barcelona Supercomputing Center (BSC) — Barcelona, Spain

4Universitat Polit`ecnica de Catalunya — Barcelona, Spain

{jean.bez, navaux}@inf.ufrgs.br, francieli.zanon-boito@u-bordeaux.fr,{ramon.nou, alberto.miranda}@bsc.es, toni@ac.upc.edu

Abstract—I/O optimization techniques such as request schedul- ing can improve performance mainly for the access patterns they target, or they depend on the precise tune of parameters. In this paper, we propose an approach to adapt the I/O forwarding layer of HPC systems to the application access patterns by tuning a request scheduler. Our case study is the TWINS scheduling algorithm, where performance improvements depend on the time window parameter, which depends on the current workload. Our approach uses a reinforcement learning technique – contextual bandits – to make the system capable of learning the best parameter value to each access pattern during its execution, without a previous training phase. We evaluate our proposal and demonstrate it can achieve a precision of88%on the parameter selection in the first hundreds of observations of an access pattern.

After having observed an access pattern for a few minutes (not necessarily contiguously), we demonstrate that the system will be able to optimize its performance for the rest of the life of the system (years).

Index Terms—Auto-tuning, Reinforcement Learning, Paral- lel I/O, I/O forwarding, I/O scheduling

I. INTRODUCTION

Scientific applications impose ever-increasing performance requirements to the High-Performance Computing (HPC) field.

These justify the continuous upgrades and deployment of new large-scale platforms. Such massive platforms rely on a shared storage infrastructure which is built over a dedicated set of servers, powered by a Parallel File System (PFS) such as Lustre [1], PVFS (OrangeFS) [2] or Panasas [3]. However, if all the compute nodes were to access the same shared file system servers concurrently, the contention would compromise the overall performance and cause interference [4], [5].

To alleviate this contention problem, the I/O forwarding technique [6] aims at reducing the number of clients concur- rently accessing the file system servers. It defines a set ofI/O nodes that are in charge of receiving I/O requests from the processing nodes and of forwarding them to the PFS. This technique is applied in several of the Top 500 machines1, as detailed by Table I. Besides alleviating contention, I/O for- warding creates an additional layer between applications and file system, that can be used for optimizations such as request reordering, aggregation, and I/O request scheduling [5], [7].

1The June 2019 TOP500 list: https://www.top500.org/lists/2019/06/.

We call the “access pattern” the way the application per- form I/O operations: spatiality (contiguous, 1D-strided, etc), request size, number of files, etc. I/O optimization techniques (including but not limited to the I/O forwarding layer) typically provide improvements for specific system configurations and application access patterns, but not for all of them. More- over, they often depend on the right choice of parameters (for example, the size of the buffer for MPI-IO collective operations). That happens because they are designed to explore specific characteristics of systems and workloads [8]. That was demonstrated to be the case for request scheduling at different levels [9], [10]. Therefore, to successfully improve performance, it is essential to dynamically adapt the system to a changing workload. A caveat is that the I/O stack is typically stateless, and does not have information about the applications’

behaviors until accesses are happening.

We propose a novel approach to adapt the I/O forward- ing layer to the observed I/O workload. In our proposal, a Councilperiodically receives metrics on the access pattern col- lected by the I/O nodes. A reinforcement learning technique, contextual bandits [11], is used so that the system can learn the best choice to each access pattern. After observing a pattern enough times, the acquired knowledge will be used to improve its performance during the whole life of the system (years).

By making the system capable of learning, instead of using a supervised technique, we eliminate the need for a previous training step, and without adding a high overhead (median

<2%). That is essential as designing and executing a training set to represent the diverse set of applications that will run in a supercomputer, and the interactions between concurrent appli- cations (over the shared I/O infrastructure), is difficult, error-

TABLE I

SOME OF THETOP 500MACHINES USINGI/OFORWARDING TECHNIQUES Rank Supercomputer Compute Nodes I/O Nodes

3 Sunway TaihuLight 40,960 240

4 Tianhe-2A 16,000 256

6 Piz Daint 6,751 54

7 Trinity 19,420 576

12 Titan 18,688 432

13 Sequoia 98,304 768

(3)

prone, and time-consuming. Finally, the continuous learning process enables the system to adapt to workload changes and system upgrades.

In this paper, we demonstrate our proposed technique by applying it to a study case: the TWINS request scheduling algorithm for the I/O forwarding layer [9]. Nevertheless, our approach can be used to tune other optimization techniques that depend on the access pattern. We present TWINS in Section II. We discuss the viability of learning and adapting in HPC machines in Section III. Section IV presents our reinforcement learning approach. The results are described in Section V. Finally, Section VI discusses related work and Section VII concludes this paper and addresses future work.

II. CASE STUDY:THETWINSSCHEDULING ALGORITHM

The main goal of TWINS [9] is to coordinate the I/O nodes’

accesses to the shared PFS servers to mitigate contention.

Each I/O node keeps multiple request queues, one per data server. During a configurabletime window, requests are taken (in arrival order) from only one of the queues, to access only one of the servers. When the time window ends, the scheduler moves to the next queue following a round robin scheme. If server i is the current server being accessed, but there are no requests to it, the scheduler will wait until either requests to server i arrive or the time window ends, even if there are queued requests to other servers. To ensure each server is accessed at different orders by the I/O nodes, each node applies a translation rule to the server identifiers.

TWINS can increase performance by up to 48% over other schedulers available for the I/O forwarding layer (we compared it to FIFO and HBRR provided by the IOFSL framework [4]), as illustrated by Fig. 1(a). These high per- formance improvements are obtained transparently, without requiring any modifications in the applications or runtime systems (except the forwarding software). On the other hand, as depicted by Fig. 1(b), for other patterns performance can be decreased by TWINS. In both situations, the selection of the value for the time window duration parameter, which depends on the access pattern, is of paramount importance.

Further details about TWINS and its performance evaluation are available in our previous work [9].

69.1 68.1 44.7 35.6 36.2

42.7 39.2

60.9 57.0

30 40 50 60 70 80

FIFO HBRR 0.125ms 0.250ms 0.5ms 1ms 2ms 4ms 8ms

Execution time (seconds)

(a)READ,8forwarding nodes

293.4 294.1 357.2 381.2 395.5

328.2 396.9

291.1 302.4 280

320 360 400 440

FIFO HBRR 0.125ms 0.250ms 0.5ms 1ms 2ms 4ms 8ms

(b)WRITE,2forwarding nodes Fig. 1. Impact of the window size on performance based on the execution time as perceived by the user (makespan). A total of 128 processes access a 4 GB shared file in 32 KB 1D-strided requests. Baseline algorithms are colored in red and TWINS results (with distinct window sizes) are in blue.

III. MOTIVATION FROMREAL-WORLDHPC In this paper, we propose an approach to adapt the I/O system to a changing workload by selecting appropriate values for parameters (such as the time window duration for TWINS), which depend on the current access pattern. The access pattern represents the way applications issue their I/O requests, i.e., aspects such as type of operation, file layout, sequentiality, size of requests, etc. In this section, we discuss the viability of applying such a solution for a real-world HPC workload.

Fig. 2 illustrates the executions of two applications as reported by Darshan [12] traces. The x-axis represents the execution time, different colors represent different access patterns, and the boxes identify I/O phases. We use the concept of I/O phases to identify intervals where I/O operations are made using an access pattern. We infer this information from coarse-grained aggregated logs. Hence I/O operations are not necessarily happening throughout those entire periods, but we can be sure that those patterns characterize the I/O operations that are. The duration of each phase is defined by the interval between the first and the last I/O operations from a sequence of operations with the same access pattern.

Fig. 2(a) illustrates the I/O behavior the Ocean-Land- Atmosphere Model (OLAM) [13], executed in the Santos Du- mont2supercomputer, at the National Laboratory for Scientific Computation (LNCC), in Brazil. We selected a job that used 240processes and ran for2433seconds, of which221seconds were spent on I/O operations. OLAM processes read time- dependent input files, write per-process logs (purple), and periodically write to a shared-file with MPI-IO (yellow).

The second application, in Fig. 2(b), is anonymously identi- fied as2201660091, job15335183665324813784from the Argonne Leadership Computing Facility I/O Data Repos- itory [14]. This execution was randomly chosen from those who spent at least30% of their time on I/O. We can see the application performs sequential writes to individual files in roughly the first half of the execution, and then it moves on to perform sequential reads from individual files.

The examples illustrates that HPC applications tend to present a consistent I/O behavior, with a few access patterns being repeated multiple times over an extensive period [15].

Therefore, one way of adapting the stateless I/O system would be to observe the current access pattern over some time and combine it with a tuning strategy. A supervised strategy (a decision tree, for example) would require a previous training step. However, considering I/O performance is sensitive to a large number of parameters, creating a training set to represent all applications (and all interactions of concurrent applications) and executing it would be difficult, error-prone, and time- consuming. Therefore the desired approach should be able to learn the best choice for each situation during the execution of applications, trying to avoid possible disturbances. The next section describes our proposal for such an approach.

2https://www.top500.org/system/178568

(4)

(a) The I/O phases of one execution of the OLAM application at the Santos Dumont Supercomputer (LNCC).

(b) Application2201660091(job15335183665324813784) running in the Intrepid supercomputer.

Fig. 2. Two real-world executions in HPC systems

IV. ADAPTIVEI/OFORWARDING LAYER

We require a solution where the I/O forwarding layer learns the best choice for different situations while they are being observed, but without a prior training process due to its high cost and complexity. Therefore we approach this as a Reinforcement Learning (RL) problem [11]. We view it as a k-armed bandit problem [16], where at each step an agent takes one of the k possible actions (for TWINS each action is a different time window duration) and receives a reward (performance). The expected reward from an action is called itsvalue. Since the value of an actionaisnot known before- hand, at the time steptwe only have an estimate of itQt(a), based on rewards obtained by taking that action in the past.

The algorithm selects actions with the highest estimated values (exploitation), but also occasionally chooses other actions to attain better estimates of their values (exploration).

Nonetheless, the values (performance with each parameter) change as the access pattern changes. To avoid having to

“reset” the learning process whenever that happens, we model our problem as a contextual bandit (or associative search task) [11]: we have multiple concurrent “instances” of the k- armed bandit, one for each different access pattern. At each iteration, only one of these instances will be active. This choice carries the assumption that taking an action does not have an impact on the following observation. Tuning the parameter will impact the performance of the current I/O phase and therefore slightly anticipate or delay the next I/O phase, but we consider this effect as negligible because the application primarily dictates the access pattern.

We implemented each of the concurrent armed bandit instances as an ε-greedy algorithm, that at step t takes the actionaof the highest estimated valueQt(a), with probability (1−ε), or with probabilityεtakes a randomly selected action.

Value estimates useincrementally computed sample averages, i.e., after obtaining this step’s rewardR, the estimate forais updated as (N(a)is the number of timesahas been taken):

Qt+1(a) =Qt(a) + 1

N(a)[R−Qt(a)] (1) Since the proposed mechanism will run in the intermediate I/O nodes, its lifetime willnot be restrained to the jobs’ exe- cution times. Consequently, after observing an access pattern multiple times, it will be capable of consistently providing performance improvements by making the best decision.

A. Architecture of the proposed mechanism

Our case study TWINS, described in Section II, aims to achieve global coordination, thus although request scheduling happens independently in each I/O node, decisions about the window size shouldnot, as multiple I/O nodes should use the same parameter value for it to make sense. Hence, we included an agent called Council to our solution, depicted by Fig. 3.

On each I/O node, the Announceris responsible for sending metrics about the observed access pattern to theCouncil, and receiving the chosen window size. The Council’s workflow consists of two steps: detection and decision. The detection phase is responsible for classifying the observed access pattern from the metrics. A newdecisionis only made if the metrics allow for a detection (for instance if there are enough requests).

Algorithm 1 details theCouncilinteractive learning process.

Once a set of metrics is received, the access pattern is detected, and the corresponding instance of the armed bandit

Fig. 3. The proposed architecture includes theAnnouncers, at the I/O nodes, and the centralizedCouncilwhere detection and decision take place.

(5)

Algorithm 1 Council Input:

ion numberis the number of connected I/O nodes εis the greedy exploration ratio

1: S←∅,window←def ault window

2: whiletruedo

3: while S.size()< ion number do

4: host, metrics←receiveM etrics()

5: reward←getBandwidth(metrics)

6: pattern←detectAccessP attern(metrics)

7: increment(N[pattern][window])

8: update(Q, N, pattern, window, reward) .Eq. 1 9: .Select the recommended window based on the pattern 10: choices[host] = argmax

window

Q[pattern][window]

11: S.add(host) 12: end while

13: .Define the window size for all I/O nodes 14: ifrandom(0,1)6εthen

15: window←randomW indow() .Explore 16: else

17: window←mostOccurringInList(choices) .Exploit 18: end if

19: announceW indow(window) 20: S.reset()

21: end while

is selected. Then the value estimate of the previously taken action is updated according to Equation 1, using the observed performance as reward. The estimates are used to determine the window size that is suitable for that I/O node (line 10). Upon making the centralized decision, the Council must decide between exploration or exploitation. For the latter, a consensus is required (line 17) between the possible divergent recommendations for each I/O node. In this work, we take the best for the majority. Investigating consensus policies for the particular case study of TWINS is subject to future work.

The centralized Council is required by our case study, but would not be if the tuned optimization tolerated different decisions being made by the I/O nodes. However, it accelerates the learning process, as parallel experiences are combined in the value estimates. It is also important to notice only the I/O nodes will interact with the Council, and not all the compute nodes. A compromise would be a hierarchical approach, where some of the ability of reaching global consensus is sacrificed for a decreased overhead. We investigate overhead and scalability of our solution in Section V-E.

B. Access pattern detection

Our solution requires a server-side classification of observed access patterns in order to identify an armed bandit instance to be used. Hence it is important for that classification to cover all aspects that have an impact on the behavior of the tuned optimization, otherwise the instances would not be able to learn properly. On the other hand, redundant classes slow down the learning, as multiple armed bandit instances cover the same behavior. Specifically to our case study, we classified the access pattern regarding the operation (read or write),

spatiality (contiguous or 1D-strided), number of accessed files, and request size aspects, since our extensive performance evaluation of TWINS showed these to uniquely identify the different behaviors. The classification of the spatiality uses a neural network described in our previous work [17].

It is important to remember this is a server-side classi- fication, where information from user-side libraries are not available and very little is known about the applications. When applying our proposal to other optimization techniques, the server-side access pattern detection must be adapted accord- ingly. If the set of relevant aspects is not known (which is often the case), a generic classification is required. In a previous work [18], we proposed such a classification strategy that covers all aspects. We represent access patterns as time series and use pattern matching to compare them. Our results have shown the same application access pattern to be represented by1 to3 patterns in the resulting knowledge base. Although that means having to observe it more times before learning, we still consider it to be a good strategy given the long life of the system (years), and considering the alternative is not adapting, and hence giving up of possible performance improvements.

V. RESULTS ANDDISCUSSION

In this section, we evaluate our proposal applied to the TWINS case study. We conduct an offline evaluation to show the learning ability (Section V-B), and an online one to show our architecture works in practice and leads to performance improvements (Section V-C). We also show the results of our approach with a real application (Section V-D) and evaluate its overhead and scalability (Section V-E). Section V-A discusses the methodology used for all experiments.

A. Experimental methodology

All experiments were carried out in clusters from the Grid’5000 platform [19] at Nancy: four PVFS2 servers in the Grimoire nodes, 32clients and multiple IOFSL nodes in separated Grisou nodes. Each node of both clusters is powered by an Intel Xeon E5-2630 v3 processor (Haswell, 2.40 GHz, 2 CPUs/node, 8 cores/CPU) and 128 GB of memory. The parallel file system servers use a600 GB HDD SCSI Seagate ST600MM0088. Nodes are connected by a10Gbps Ethernet interconnection, and there are four 10 Gbps links between the clusters. Both clusters were entirely reserved during the experiments to minimize network interference.

PVFS version 2.8.2 was deployed with default 64 KB stripe size and striping through all data servers. They write directly to their disks, bypassing caches, to ensure the scale of tests would be enough to see access pattern impact on performance. Clients are equally distributed among the I/O nodes, that communicate directly with the file system through the IOFSL dispatcher. The IOFSL daemon was launched with all its default parameters, aggregating up to 16 requests in dispatch, and using4 to16threads.

Since the experiments in Sections V-B and V-C require metrics to guide our learning mechanism and determine the best scenario in the offline simulations, we used the MPI-IO

Références

Documents relatifs

Décrire les résultats des réparations chirurgicales pour traumatisme de la voie biliaire principale survenu lors d’une cholécystectomie dans le contexte

Un t el État exigerait dès lors le renvoi des convictions religieuses dans la sphère privée et ferait preuve d’une certaine forme de neutralité en traitant

Since error analysis in grammar serves as an effective way to improve writing proficiency, in order to make English teaching more efficient in our department,

Impact of the HDAG graph size on the execution time of the LTE uplink schedul- ing on the architecture in Figure 5 with one core reserved for the scheduling. In Figure 13, we can

Indeed, the proposed solution, named EDDPG, not only improves the exploration mechanism sug- gested for the Deep Deterministic Policy Gradients (DDPG) technique [6], it allows,

The first three descriptors in the state space and the last one in the action space are related to the execution time of jobs.. In this work, we compare

( 2008) Translocating lions into an inbred lion population in the Hluhluwe-iMfolozi Park, South Africa. ( 2004) Patterns

In this paper, we suggested dynamic programming model for dual crane stocker scheduling problem and developed the model into the deep Q network (DQN).. We obtained an optimal