That's what we're all about. The unit sponsors several rallies a year and always welcomes more. If you have never planned a rally, this guideline will give you some idea of what is involved. It's a good idea to attend at least one 4CU rally and recommended that new hosts serve as co-hosts prior to hosting a rally. This will give new hosts first-hand experience of what is expected at a rally and how a variety of details are managed.
It's highly recommended to enlist a co-host for rallies in order to share the burden of planning and hosting, and as backup in case a situation develops that precludes your attendance.
Please feel free to discuss your rally ideas with one or more Board member for their input. When you have enough details to put together a general rally proposal (dates, venue, venue amenities, rough agenda, costs, etc.) please submit your rally proposal to the Board for review and approval before any expenditures are made. If this creates an issue in the reservation process for a given venue, please consult the Board. The Unit will not be responsible for expenditures made prior to approval.
Rallies can occur throughout the year. Keep in mind the dates of other events which may impact the attendance of the rally. Allow enough time to handle all of the logistical things to be taken care of.
People enjoy variety. It's always nice to visit someplace new as well as returning to old favorites. Potential rally sites should be convenient and offer useful services within a reasonable distance. Dry camping is fine but consider hook-ups, particularly electricity for air-conditioning in warmer seasons. When you have selected a location it is a good idea to have one individual point of contact to work with at the location.
Although a theme isn't necessary for a successful rally, it often adds to the fun both in the planning stage as well as the during the event.
The rally fee should be based on the activities included and any park use or related costs. Base the price on the number of anticipated participants and the events included. At a minimum, most public facilities will charge a use or permit fee for the use of group areas. While it is not feasible in all cases, it is encouraged that individuals pay their own campsite fees. See the section Collection of Fees below for more detailed information the financial aspects of a rally.
There are several ways to promote the rally. A well-promoted rally will ensure a successful event that will be well attended. Contact the Unit Secretary to have the rally listed on the WBCCI calendar and in the Blue Beret. The Unit Webmaster will add it to the 4CU website. Submit the details to the Unit Newsletter Editor.
So there will be no surprises when the event date rolls around, it is a good idea to know a little about the territory. Survey the campsites so you can assist placing anyone with special needs and hold a specific site for them. You don't need to be an expert on the region around the rally site but it is a good idea to know the location of the nearest medical facility, drug store, grocer and other services.
While it is not necessary it's nice to prepare a rally bag for the attendees. This could include some brochures, maps and information for activities if an attendee chooses to do something on their own. In most cases, with a phone call or visit to a local chamber of commerce or visitors bureau you will be supplied with a variety of information at no cost.
As the rally date draws near you will begin to collect fees (if there are any). International guidelines require that all funds collected be deposited directly to the Unit's bank account with fee checks being made payable to the Four Corners Unit rather than an individual member. The Unit Treasurer will provide unit deposit slips that the host can use to deposit funds collected into the Unit's bank account. At the close of the rally, the host is required to provide the Unit Treasurer with a full accounting of all funds received and all funds dispersed in the planning and execution of the rally. The financial report can be a simple spread sheet or even a simple statement listing the funds collected and the expenditures made. Please keep all supporting receipts for items purchased and venue fees paid for the rally and submit with your financial report. The Unit Treasurer will make reimbursements for rally expenses from the Unit's account. The Unit will retain any funds remaining from the fees collected after reimbursements are made.
Legal liability is a big issue for organized gatherings like this. Since this is actually an official WBCCI sanctioned event, the WBCCI specifically carries liability insurance for this. If the rally site requires certificate of insurance, we will contact WBCCI and they will arrange to have one provided to the venue.
Hosting a rally can involve a lot of activity (read this as meaning that it involves some work.) Don't be afraid to solicit volunteers - people love to help. Greet the attendees as they arrive. Be available to offer assistance and answer questions that people may have. Make sure the rally area is left cleaner than when we arrived. Most importantly have fun. That's what rallies are all about.


text:
Can You Hunt With An Ar 15 In California?
June 1, 2022 Alexis
You can hunt with an rifle in California, but you have to follow strict State regulations. If you follow and play by the rules, you can hunt with your trusted rifle in California.
Is it legal to hunt deer with a 223 in California?
Is it legal to hunt with an AR-15?
Can you hunt with a 5.56 AR-15?
Is a .223 good for deer hunting?
Is an AR-15 different from a hunting rifle?
What is an AR-15 rifle used for?
Is .223 or 5.56 better for hunting?
Can you deer hunt with an AK 47?
Is .223 and 5.56 ammo the same?
Can you have AR pistol in California?
What's the smallest caliber for deer hunting in California?
What is a .223 rifle good for?
Is a .22 good for deer hunting?
What is the best rifle for deer hunting caliber?
Is an AR a good hunting rifle?
What does the 15 in AR-15 stand for?
Is the AR-15 a high powered rifle?
Is an AR-15 considered a military grade weapon?
How powerful is an AR-15?
What rounds can an AR-15 shoot?
What are green tip bullets?
Is 5.56 better than 9mm?
What is better AK-47 or AR-15?
Is AK-47 better than AR-15?
What kind of guns are used for hunting?
Is green tip ammo good?
How far will a 556 bullet travel?
What is the biggest AR caliber?
What is the largest AR caliber?
What makes an AR-15 pistol?
What makes an AR pistol not a rifle?
Is an AR pistol considered an assault rifle?
The bullets are made with metal jackets, which is against the law. Nonlead bullets are usually a specialty type for hunting in California. It was the same as the similar 5.56.
Most states allow hunting with popular rifles such as the AR-15. Whether you're hunting deer or looking for smaller game during the off-season, these rifles have a lot to offer.
The caliber is 223/6.56 and is used for deer hunting. While shots should still be limited to ranges maxing out at around 100 yards, hunters can now feel confident in taking their rifles outside during deer season.
When the appropriate bullets are used, it's a viable deer gun. When shots are not long and a broadside shot presents itself, it's good. It isn't a sure thing. When the angle or distance isn't right, you should pass on the animal.
See also Can A Felon Hunt In Oklahoma?
The rifle can be used for hunting, but it's not a hunting rifle. It is the standard. There is not much stopping power for anything other than small game in 223 caliber bullets.
According to the group, the AR should stand for "America's Rifle" because of its popularity. The AR-15 is popular among gun users because of its ability to be used in sports shooting, hunting and self-defense, according to a 2016 post by the National Rifle Association.
After comparing the two bullets, we can say that they are the same. The 5.56 is a good projectile for the battlefield and the 223 is a good projectile in civilian use.
Regardless, the AK-47 has a simple, reliable safety, low recoil and punches 30-caliber wound channels in deer at more than 1500 frames per second. Some deer hunters hike for miles, plan their shots, use bi-pods and aim carefully for a once-in-a- lifetime 400 yard shot uphill.
The 223 rounds are roughly the same size as the 5.56mm rounds. It means that most of the time. The bullets will fire in a 5.56mm chamber and the other way around. The biggest difference between the two is that the 5.56x45mm bullets have a higher pressure.
A short barreled rifle is illegal if it has been used. Building a pistol from a stripped or complete lower is not legal in California due to the fact that long guns are not allowed. It's just as bad to have an illegal rifle as it is to have a machine gun.
It's legal to use that. It is possible to hunt deer in California with a soft nose or expanding bullet.
They are not weapons of war. The rifle is popular for home defense use. There is a. There are many calibers for bolt action and single shot rifles.
If shot placement is accurate, the 22LR can be used to kill a deer. 22LR is not a legal gun for hunting deer in most US states because it doesn't have enough power to ethically hunt a deer and make sure a quick kill.
See also What Is Unicorn Hunting Mean?
We think the best rifle calibers for deer hunting are the. There are two types of firearms, the 7mm and the 270 gun. Springfield is in the state of Illinois from 30 to 6. There are 6.5 Creedmoor and.
The AR-15 is a great hunting rifle. Younger or smaller hunters will find the vertical grip and magazine more comfortable when shooting their rifle.
The company that developed the rifle in the 1950s is referred to as "Ar-15" by the rifle's name. "AR" doesn't mean "automatic rifle" or "assault weapon." An assault rifle is ready to use.
The owner of a gun store says that the rifles are not high-powered. The round is compared to the larger one. The lack of kickback is one of the reasons why 22 caliber is used to teach beginners how to shoot. The ones people don't have a problem with are the high powered rifles.
No single feature of the AR-15 can be considered military grade. The major features of the AR-15 are found in other firearms as well.
AR-15-style rifles are chambered in less powerful calibers than other hunting rifles of the same caliber, so they are not as powerful as big game hunting rifles. There are 30 to 6 Springfields. There was a win of 300.
The rifle is usually chambered for the military's 5.56x45mm. There is a gun in this picture, 222 Remington. Because of the pressures associated with the 5.56x45mm rounds, it's not advisable to fire them in a rifle. It can cause damage to the rifle or injury to the shooter.
Most of the green-tip bullets are used in 5.56/. The 223 Rem caliber can be used with the augmented reality platform. One of the criteria of the federal definition of armor-piercing ammunition is that these rounds meet.
You might think that the 9mm pistol is louder than the 5.56 rifle, but it's not. They are very close to each other. The 9mm cartridge has an average decibel of 166 and the 5.56 has an average decibel of 169.
The AK-47 is cheaper and more reliable than the AR-15 rifles, even though the AK-47 has a higher accuracy rate. The military and police use both of them, as well as for hunting rifles and self-defense.
See also Whats The Best Deer Caliber?
The AK-47 has an effective range of 300 to 400 yards, and a good marksman can take it to the limits of accuracy. The AK is more accurate than the AR-15 because it has tighter tolerances. A marksman will hit the bull's eye.
The greatest accuracy and range of all hunting weapons can be found in rifles. Centerfire rifles can be used to kill big game. Rimfire rifles can be used. Small-game species can be killed with 22 Long Rifles.
The advantage of being able to punch through a barrier is that you don't need a larger cartridges. The green-tipped round is a quality round that fires reliably and will not cause excess carbon build up in your rifle.
The US Army Technical Manual states that the 556 has a 547-yard range for individual or point targets. When using a rifle, the individual or point targets range is up to 602 yards, and the area target is up to 825 yards.
There is a modified version of the. The bullet was made by Smith & Wesson. The smaller version of the AR-15 was used to build the Auto Max, which has a 7.62 millimeter caliber.
The smaller version of the AR-15 was used to build the Auto Max, which has a 7.62 millimeter caliber. There are a number of larger calibers that can be accommodated by the AR 10. There is a number of Federals.
An AR-15 pistol has a shorter barrel than 16 inches, does not have a stock, and is shorter than 26 inches. A pistol is defined by the lack of a stock.
The shoulder stock is the only thing that distinguishes an AR-15 pistol from a short barreled rifle. You can convert a pistol to a rifle, but you can't do the same thing with a pistol.
According to the website of the National Shooting Sports Foundation, theAR-15-style rifles are not an assault weapon or an assault rifle. An assault rifle can be a machine gun. Since 1934, automatic firearms have not been allowed to be owned by civilians.
Is 308 Legal For Deer In Michigan?
May 26, 2022 Alexis
How Many Dogs Do You Need To Hunt Bear?
May 25, 2022 Nathaniel
Previous: What Does God Say About Sacrifice?
What Does God Say About Sacrifice?
Can I Use The Word Lego In My Business Name?
Can I Get Free Shipping On Dhgate?
Is Parking Free In Nyc On Mlk Day?

redpajama_set_name: RedPajamaCommonCrawl


text:
If you're reading this you're interested in Gov 2.0 but you're not from Customs.
Last week's Cebit Australia Gov 2.0 Conference in Canberra was the subject of these reports of proceedings and related interviews. In addition to lots of positive comments about how things are going, the possibilities for the future, and the constant refrain of the need for culture change, were these tidbits of particular interest (emphasis added):
IT news- amid all the talk about new tools, Customs says even accessing a site that looks like a blog is out:
"Mia Garlick, assistant secretary for digital economy branch DBCDE shared some cautionary tales on the path to open government thus far. Stressing she was not speaking for her Department but in a "personal and professional capacity"........ she discussed the recent case of Customs prohibiting staff from accessing Open Australia.org because it was classified as a blog and posed a threat to Customs' border and protection network. "Firstly Open Australia is not a blog," Garlick said. "It is actually an amazing example of Gov 2.0 in this country. It takes Hansard - which is very clunky and it repackages it into a searchable and easy to access form and it allows you to sign on for email alerts whenever your issue is mentioned in Hansard records. "That seems to me to be a useful and essential tool to those that work in Government." Garlick also questioned how a blog could be classified as a security risk. "Is anyone here from Customs Service in this room?" she asked. "You probably don't know that there are other blogs out there. Some of those blogs for example are the Whitehouse, another is the Department of Finance, my Department has a blog. There are lots of people are now using blogs."
ARN interview with Minister Gray, reveals he's a busy man, and:
"I mentioned Reinecke's report (on progress on IT reform) and that was commissioned quite a few months ago. It needs to be made public and the deliberations around it need to be publicly ventilated. My personal view is that that's a more valuable contribution than me talking to a whole range of people I also have a fundamental view that when the Government produces a substantial piece of work with insights into how we do what we do you can only get value out of making them available to the public. That's why Ian's report will be released."
Government News: a reminder from the UK that Gov 2.0 is not just techo territory:
"Andrew Stott director for transparency and digital engagement in the UK Government's Cabinet Office delivered the international keynote address. The so-called "twittercrat" said it was more important for governments to focus on openness and releasing data sets, rather than Web 2.0 tools. "It's not an IT project," Mr Stott said. "This is not a technocrat activity. This is about increasing the transparency of government." Mr Stott stressed the importance of political backing for Government 2.0. "Leadership is not just something you need from your CIO," he said. "It's political leadership and leadership from the top of the organisation. "You've got to have consistent policy principles and use those to make tough decisions."
Computerworld: just who is doing what and why:
"According to IBRS advisor, Guy Cranswick, while it was positive that governments were opening up and communicating with the public, the motivation was not greater transparency of government. "It is all very well government doing this, but to a large degree they are really satisfying their own internal constituencies and stakeholders — other people and agencies around the world," Cranswick said. " "I am not that convinced that the general public is that involved in [Gov 2.0] and that it has been executed that well."
Posted by Peter Timmins at 10:58 am
Labels: Gov 2.0
Wikileaks likely set back to open government cause...
Experienced FOI hand set to be Vic Minister for FO...
Disclosure of payments to pollies- improving, coul...
Ponemon in Sydney next week
Accountability Roundtable digs out some answers in...
Foreign affairs and the challenge of open governme...
Privacy issues when the police come calling
Penchant for darting and weaving over secrecy
No worries, no hurry, on privacy reform
One side talking about transparency in Victorian e...
The Senate pursues the PM's "let the sun shine in"...
Dispute over tabling NBN document a harbinger of t...
Norfolk islanders still waiting
Shield law for quick Senate committee inquiry
NSW ICAC proposes more transparency for lobbying a...
Journalists run rings around the professions to pr...
Many NSW disclosure logs yet to disclose anything ...
"New disclosure czar hits ground running"
Information warrior still turning up hidden gems
500 Freedom of Information applications behind top...
NSW makes a welcome start on political donations
Different strokes..
Ministerial advisers unaware of changing times
Timely external review a problem in the west
Commonwealth Ombudsman brief on FOI.
"We want to be the most open and transparent gover...
The case of the council manager's performance revi...
If you're reading this you're interested in Gov 2....
RBA disclosure to one, to all
Australia missing from survey of budget transparen...
Chief Justice reflects: admin law has come a long ...
NSW Information Commissioner takes GIPA on the roa...
Broadband, Communications and the Digital Economy ...
NSW whistleblower protections welcome but short of...
The Minister and the Commissioner respond to quest...
Australian Information Commissioner launches forth...
Joy to the world and tax lawyers!
House passes shield law


In his capacity as an Editorial Writer for DodgersNation.com, Attorney Jeremy Evans with California Sports Lawyer®, has written an article about the effects of CTE in professional sports.
"Most decisions in life, particularly in the family and team setting, derive from two basic and understandable principles: love and self-preservation. The two are not mutually exclusive. You can both love your brother or sister and find a way to live and live well. Therefore, according to a Sports Illustrated article, when "Boston University researcher Dr. Ann McKee examined the brains of 202 deceased football players and found that 110 of the 111 brains of former NFL players had chronic traumatic encephalopathy (CTE)," we had three first thoughts . . ."
Next: MLB Inquiry: Have the Dodgers Abused the 10-Day Disabled List Rule?


text:
Meaning 'Land of the Gazelle' in Arabic, Abu Dhabi was founded when a young antelope led a wandering tribe to fresh water, on an island with no more than 300 palm ('barasti') huts, a few coral buildings and the Ruler's fort. This simple island settlement has since been quickly transformed into the modern, cosmopolitan city of Abu Dhabi and the high-rise capital of the United Arab Emirates.
Abu Dhabi is turning into a world-class and sustainable destination, in line with the commitment to conserving, promoting and leveraging Abu Dhabi's heritage, history, culture and tourism assets. Abu Dhabi's investing heavily and continuously on the diverse array of leisure, entertainment, cultural attractions, artistic happenings and a comprehensive programme of profile-raising events.
Abu Dhabi has a diverse and multicultural society. The city's cultural imprint as a small, ethnically homogeneous pearling community was changed with the arrival of other ethnic group and nationals. The cosmopolitan and tolerant atmosphere gradually growing leads to one of the safer place in the world, with the diversity of cuisine, churches and temples can be found alongside mosques, the behavior and the dress code are fairly liberal towards women.
Find out more about Abu Dhabi's religion and traditions with a visit to one of the world's most impressive landmarks, the stunning Sheikh Zayed Grand Mosque with a capacity for an astonishing 40,000 worshippers, features 80 domes, over 1,000 columns, gold plated chandeliers and the world's largest hand woven carpet.
Head to the Corniche and enjoy an impressive eight kilometres of manicured waterfront that includes children's play areas, separate cycle and pedestrian pathways, cafés and restaurants, and a lifeguarded beach park. While in Abu Dhabi, don't forget to get on the water. From wake-boarding to surfing and parasailing, from cruising in a traditional pearling boat to kayaking through our natural mangrove forests, the emirate's waters are yours to.
For a 360˚ entertainment experience, head to Yas Island - home to the annual Formula 1 Abu Dhabi Grand Prix, the world's fastest roller coaster at Ferrari World Abu Dhabi, the famous water park Yas Waterworld and the the world's largest Warner Bros. branded indoor theme park - and to Saadiyat Island, discovering the world famous Louvre Abu Dhabi.
Shopping is something of a national pastime in Abu Dhabi, perhaps because it's so diverse and tax-free: everything from luxurious and ultra-modern malls with the latest brands, to small, souk-like shops where you can buy traditional perfumes, handicrafts, spices and carpets.
If you're interested in culture and heritage, catch a cab to the Heritage Village on the Corniche Breakwater and step back in time to a traditional desert lifestyle or visit one of the many archaeological and historical sites throughout the emirate, including the UNESCO World Heritage Sites.
For more information on Abu Dhabi or the events please visit.


This beautiful stone built farmhouse has three large double bedrooms, a separate three bed cottage a large attached barn and Old Bakery - perfect for conversion into another Gite, subject to the correct permissions, all set in 6000m2 of land. Just 1km to village with all commerce, 9kms to Ste Foy la Grande, 35kms to Bergerac and 1 hour to Bordeaux.
This spacious 4 bedroom modern family home sits in a lovely enclosed garden of 7000m2 with gorgeous views over the vines. The property consists of a large open plan living/dining area of 55m2 with fully fitted kitchen. There is a family bathroom and a separate wetroom. The house is double glazed throughout and benefits from being on mains drains.


UNITED NATIONS, May 28 -- Tomorrow is the Day of Peacekeepers, but today at the UN getting information from or about the Department of Peacekeeping Operations was like pulling teeth.
At the noon briefing Inner City Press asked about Sudan, Syria and the Congo. By day's end, the only answer came not from DPKO but from the President of the Security Council for June, UK Ambassador Mark Lyall Grant. That's appreciated, but where's DPKO?
It wasn't just Inner City Press getting stonewalled on Syria. Russian and Lebanese reporters started asking about the kidnapping of peacekeepers in the Golan Heights, to which Deputy Spokesperson Eduardo Del Buey said, "Well, Mr. Ladsous will be here tomorrow."
Inner City Press: if I could just follow up on that, because I think on Friday I had asked you about a 22 May letter from the Syrian Mission to DPKO (Department of Peacekeeping Operations), what… whether they would say what the contents were. Were you able to ask DPKO that?
Deputy Spokesperson Del Buey: We do not divulge the contents of letters from missions to us or to them.
Deputy Spokesperson: I am not aware of any requests to the Secretariat for an investigation to Qatar, no.
Inner City Press: So that's not what the 22 May letter is?
Inner City Press: on the DRC, there are reports that the intervention brigade is actually being being delayed, that so far only 500 from South Africa and [the United Republic of] Tanzania have arrived, and there are credible reports that South Africa is dissatisfied with the leadership of the brigade being given to [the United Republic of] Tanzania, of MONUSCO's (United Nations Organization Stabilization Mission in the Democratic Republic of the Congo) force commander being from Brazil, and may in fact not deploy. Do you have any response to that?
Deputy Spokesperson Del Buey: I have no information on that, Matthew.
Later on Tuesday UK Ambassador Mark Lyall Grant tweeted that he had just met with this Brazilian Force Commander, General Cruz. Inner City Press asked if he'd indicated when the Intervention Brigade might be fully deployed, and about any briefing of the Council in June, when Lyall Grant is president.
Lyall Grant replied that two months sounded about right for full deployment of the Brigade, and that General Cruz might be one of the three Force Commanders to brief the Council on June 26. (These Force Commander fests can be newsy - click here for Inner City Press' July 2011 story, Sudan and South Sudan.) It's a new world, at least in social media or "digital diplomacy."
Inner City Press: there are reports that the Chadian army has passed through Darfur and is now pursuing a JEM (Justice and Equality Movement) column in Southern Kordofan. Since there is a UN peacekeeping mission in Darfur, I am wondering, do they deny this, do they have any knowledge of this? And the in-house question is, I would again reiterate this concern about the draft media access guidelines which would limit media workspace in front of the Security Council, the posting of flyers that are substantive in the area and keep all but Resident Correspondents out of the Delegates Lounge. I'd like you to convey that to them and also to ask when those guidelines, it hasn't been explained to me when they would actually go into force and therefore whether there is an opportunity to really get the Secretary-General to speak whether he stands behind them.
Inner City Press: You are party to the agreement, [the draft Media Access Guidelines]. Is that…?
Deputy Spokesperson: …you've got the answer we have given. If you want any more information, you are in contact with DPI; do it with DPI. With respect to reports on Darfur, we have, UNAMID (African Union-United Nations Hybrid Operation in Darfur) visited the area and there have been no indications of any armed forces presence in that sector.
Inner City Press: In Southern Kordofan? They visited Southern Kordofan?
Deputy Spokesperson: No, they haven't visited Southern Kordofan, but we'll have to check on that. But so far their analysis is that there is no foreign presence there.
Beyond Chad, there are reports of death and pull outs of Abu Karshola. So where is DPKO in all this?
Footnote: on the issue of the possible reduction in media workspace in front of the Security Council, specifically a table which was always in front of the Council before it moved to the basement, and was maintained in the basement, it is still not known what will happen on June 1. Video here.
What seems most reasonable is to allow a table in the space between the steps down from the second floor lobby to the Council and the Turkish Lounge. That space is smaller than what the media had before, but a table to work on makes it possible for correspondents to cover entire Council sessions, and not just ten minutes at the beginning and end.
This is particularly important since Permanent Representatives, particularly on the Permanent Five members, often leave after they speak in consultations, and before the session is announced as over. If a journalist is not at the stakeout then, they (and the diplomat) lose the chance.
Also, Council presidents hold bilateral meetings in the Council, and the proposal rule would discourage any media presence outside the Council at those times, and the lack of a table would make presence even less likely.
The best way would be to stay or suspend the proposed rule and let it be figured out during June -- WITH a table in place. The sooner this could be clarified, the better. On May 29, not only Ladsous at noon, but also Ban Ki-moon himself is slated to take press questions, at 5 pm after Council consultations on the Congo. Watch this site.


TOAE is less then a week away and I'm in full on preparation mode! Yesterday I picked up a bunch of paintings from the gallery so everything I want to bring is in my studio. I have one more piece that needs to be finished, it only needs one more layer of varnish and it needs to be photographed, wired and given a tag and a certificate on the back. Here's a little sneak peek at the piece while I was working on it.
Yesterday I created a couple of T-Shirts for me and my husband to wear during the exhibition, they have an image of one of my artworks on the front and my logo and website on the back, I made a different T-Shirt for every day :) I'm super happy with how they came out, what do you think?
I'm super excited! For now the weather is looking promising, fingers crossed that it stays that way! I'll be taking loads of pictures and video over the weekend so keep an eye on this page and my Twitter, Facebook and Instagram feed for updates on the event :) For the people who will be visiting TOAE next weekend, I'm going to be in booth G32! On Friday and Saturday the exhibition will be open from 10:30am to 7:30pm and on Sunday from 10:30am to 6:30pm. The information center will be located in the large tent right in front of the main doors to City Hall. There will also be packaging and framing services on site as well as a variety of food vendors. I hope to see you all there! Let's make it an awesome weekend!
Creative ramblings #12: How to build a crate to transport your paintings.
It's time for a new episode of Creative Ramblings! In this weeks episode my husband Sonny and I show you how to build a crate to easily transport your paintings to and from a show.
This is all part of my preparations for TOAE (the Toronto Outdoor Art Exhibition) which is coming up fast! (July 4, 5, 6). I'm very, very busy with the final preparations, I've finished my booth design, created some lovely sheets of fabric that will cover up the wire panels that will support my paintings in my booth and I've finished most of the paintings I want to bring. I still have one big one (24x36) and a couple of tiny ones to finish and I have a couple of paintings that still need some varnish, and a wire.
RAWtastic night at the Rialto Theatre!
We had an absolutely amazing time at Panorama this past Friday! A BIG thank you to the organization, my fellow participating artists and all the people that came out, you all made this an unforgettable night!
The Rialto theatre is an amazing venue for an event like this! The beautiful decor made for such a lovely background for all the amazing artwork, it really gave the whole event a very classy feel! With the help of my amazingly supportive husband I created a nice little overview video of the event as well as some nice pictures which you can see below. Professional photographic and video material will follow at a later date.
Everyone who buys tickets using this link will have a chance to win this awesome limited edition signed giclee print of 'Montréal'.
In this weeks episode of Creative Ramblings you can check out some of the artists and acts that will be performing at this amazing art event.
Panorama will be held at the Rialto Theatre in Montréal on June 13th 2014 from 7-11:30 pm. Tickets are only $15,- if you buy them through this link (they will be $20 at the door). I'm looking forward to seeing all of you there!
It's funny how your perspective changes... I've been living abroad for almost 10 years now, first Texas, currently Canada and in the future... who knows. Once or twice a year we travel back to Holland to visit family and friends and after living abroad for a prolonged period of time, I'm looking at my home country through the eyes of a visitor. All of a sudden I notice little details I've never noticed before. Now I look at the shape of the houses, the placements of traffic and street signs and the cool texture that is created by the little cobble stones that pave the streets.
Now, whenever I visit Holland I'm armed with my camera and I shoot as many pictures as possible, there's so much to see and so much to photograph, I can't help myself! I love the fact that living abroad has given me a completely new way to view my home!


text:
The Nice/Emerson, Lake & Palmer/Asia
Here you can see in chronological order those titles from the larger list that cover the bands The Nice, Emerson, Lake & Palmer and Asia.
You can go directly to the following sections:
I. Books and articles already published
II. Books that have not been published yet
III. Books in the making
I. Books and articles already published:
Sinfield, Peter: Under the sky. A collection of lyrics and poems. London 1973. ISBN: 0-85115-0349.
(Contains the Lyrics to some King Crimson and ELP songs, along with other poems.)
Hartwich-Wiechell, Dörte: Pop-Musik. Analysen und Interpretationen. Köln 1974. ISBN: 3-87252-078-4.
(Especially interesting is a chapter on "Zeugnisse des Eklektizismus und der Rückwendung", pp. 282 - 297.
She offers a matrix for adaptions of classical music, starting with close reproduction
and ending at free interpretation and mere stylistic inspiration.
Among others, she discusses ELP's "Abaddon's Bolero" and The Who's "Tommy".
On pp. 279 - 281 she also discusses Deep Purple's "Child in Time".)
Imaizumi, Hiroshi: Emerson, Lake & Palmer. Tokyo 1977. No ISBN.
(In japanese.)
Palmer, Carl: Applied Rhythms. Modern Drummer Publications, Cedar Grove NY 1987. No ISBN.
(Contains transcriptions of a few tracks, mainly Asia stuff, but also some ELP (the shorter, simpler songs)
along with Carl's comments on each song.
Get the book on the modern drummer publications website.)
Pethel, Blair: Keith Emerson: The emergence and growth of style. A study of selected works. Ann Arbor 1988. No ISBN.
(A doctoral thesis in musicology. Very detailed analyses.)
Jacobs, Brian: Keith Emerson. Interviews. Keyboard Magazine edition. Japan 1992. ISBN: 4-8456-0040-4.
(It seems to be a collection of interviews in Japanese of 263 pages.
It is not clear whether it is a book or magazine format.
More information here, if you can read it... Can be ordered here.)
Ford, Peter T.: The Compositional Style of Keith Emerson in "Tarkus" (1971) for the Rock Music Trio Emerson, Lake and Palmer. Indiana State University, Terre Haute Indiana 1994. No ISBN.
(Dissertation. Can be ordered from: University Microfilms International, 300 North Zeeb Rd., P.O. Box 1346, Ann Arbor MI 48106-1346)
Matsui, Takumi: Emerson, Lake & Palmer. Tokyo 1996. ISBN: 4-924880-85-X.
Covach, John: Emerson, Lake & Palmer's Trilogy. From: Progression Magazine, fall 1997.
(This is an online article. Click here.)
Lake, Greg: Word Sculptures. Lyrics from the Musical Life of Greg Lake. Greg Lake Ltd. c/o Pilato Entertainment, Rochester, NY 1997. ISBN: 0966505409.
(The Greg Lake website says: "The book features the lyrics to over 40 of Greg Lake's songs,
including "Lucky Man", "In The Court Of The Crimson King", "Daddy", "Take A Pebble",
"From The Beginning", "Closer To Believing", "Still... You Turn Me On", "Karn Evil 9",
"C'est la Vie", "Watching Over You", "Manoeuvres" etc.
Additionally, there is an introduction by Greg Lake, and a photo section spanning
Greg's entire musical career." More information can be found on Greg's website. Thanks To John Kuge.)
Vasvári-Tóth, Tibor/Krisztina Újvárossy-Nagy: Emerson Lake and Palmer. Budapest 1999.
(Rare Hungarian biography with band biography, album reviews,
48 page database. 360 pages.)
Loog Oldham, Andrew: Stoned. London Secker & Warburg, 2000. ISBN 0-436-28866-4.
(This is the autobiography of the Stones manager who also was the manager,
among others, of The Nice, taken from conversations between Oldham and
Pete Townshend, Keith Richards, Mary Quant and others. Throughout it all,
Oldham emerges as brilliant, manipulative, slightly sinister and ultimately unknowable.)
Holm-Hudson, Kevin: A Promise Deferred: Multiply Directed Time and Thematic Transformation in Emerson Lake and Palmer's "Trilogy". In: Holm-Hudson, Kevin (Ed.): Progressive Rock Reconsidered. New York 2001, pp. 111 - 120. ISBN: 0815337159.
Forrester, George/Martyn Hanson/Frank Askew: Emerson, Lake & Palmer. The show that never ends. A musical biography. London 2001. ISBN: 1-900924-17-X.
(Surprisingly a rather weak book on ELP.
It consists of 2 parts: Part one has the band's history, with some information on the years
before ELP has been formed, part two consists of analyses of most of the band's tracks.
The first part does not provide much new information, despite a very interesting chapter on the
disasterous "Works"-tour, part 2 is even weaker, for it doesn't have anything you wouldn't hear by yourself.
Nevertheless, it contains a good discography. A new edition seems to be in the making. More info here.)
Gallant, David: Asia. The Heat Goes On. The Authorized Asia Biography. Summerside, PEI, Canada 2001. ISBN: 0-9688584-0-6.
(A book on Asia, most interesting for Prog fans for it descibes a comparatively less known phase
in the life of three important Prog musicians, Steve Howe, John Wetton and Carl Palmer.
The book gives detailed insight in the band's career, even when it didn't exist.
Concerning the eighties, the book unfortunately focuses mainly on Wetton.
As there already is a Wetton biography and a book on ELP, more information about Howe and Downes
(who has been the band's leader ever since the early nineties) would have been welcome.
But this is only a minor flaw, the book is absolutely worth reading,
for it describes the career of a couple of great Prog musician during a time when Prog seemed to be over.
Available here.)
Hanson, Martyn: The story of The Nice: Hanging on to a Dream. London 2002. ISBN: 1900924439.
(A book on The Nice. This book has several faults. First and most severe fault:
Keith Emerson wasn't available for interviews. The reason is that he wanted to save
his best stories for his own book, but certainly this one lacks his input. Secondly,
the book is not very well proofread. Then there are certain things lacking, for example:
All bandmembers are introduced in little biographies with the strange exception of
Pat Arnold, without whom The Nice would never have existed. Then we read about the band members'
reactions to Emerson's dismission of the band - with the exception of Lee Jackson.
On the other hand, it has strong appendices: discographies, gig lists and the beformentioned
biographies. In the end: not the book I expected, but the only one about an important band. More info here.)
Emerson, Keith: Pictures of an Exhibitionist. London 2003. ISBN: 1-904034-79-9.
(This is a man's book about a men's world. Full of trips and fucks. Very honest, but not really a
chronological history of KE, The Nice or ELP. Moreover, the book sort of ends in 1978.)
newly added Kawamoto, Akitsugu: Beyond Cover: Emerson. Lake and Palmer's restructure of Pictures at an Exhibition. In: Musicology and Globalization: Proceedings of the international Congress in Shizuoka 2002. Tokyo 2004. ISBN: 4990228200.
Kawamoto, Akitsugu: 'Can You Still Keep Your Balance?': Keith Emerson's anxiety of influence, style change, and the road to prog superstardom. In: Popular Music XXIV 2, May 2005, pp. 223-244.
Shaw, Matthew: A dissertation about ELP's "Pictures at an exhibition". 24 pages, 2005.
Kawamoto, Akitsugu: Forms of Intertextuality: Keith Emerson's Development as a "Crossover" Musician. Dissertation Chapel Hill 2006. No ISBN.
("This 356 pp. dissertation suggests the need to view intertextuality in its multiplicity
and dynamism, by disclosing and interpreting a variety of intertextual practices and their
important historical developments in the case of prog-rock keyboardist Keith Emerson's 'crossover' music.
Emerson's general style of blending 'rock' and 'classical' music is elucidated in comparison
with that of other prog rock musicians." More information here. )
Lupis, Giuseppe: The published music of Keith Emerson: Expanding the solo piano repertoire. University of Georgia, Athens 2006. No ISBN.
("My DMA dissertation, which will include the reprint and piano arrangement of 13 mostly out-of-print compositions
by Keith Emerson is scheduled for April 20, 2006. In my DMA dissertation you will find among other information:
where to find his music scores, what has been published, what is out-of-print, what is new."
From Giuseppe Lupis' website.)
Macan, Edward: Endless Enigma. A Musical Biography of Emerson, Lake and Palmer. Chicago 2006. ISBN: 0-8126-9596-8.
(The book covers the band' history from the recording
sessions for their first album in June 1970 to their final implosion
in December 1998, the book is both a biography of the band and a critical
survey of all of the ELP albums (including ELPowell and Three), as well as of the solo work of
Emerson, Lake and Palmer individually. Find out more here. Thanks to Edward L. Macan.)
Marshall, Polly: "The God of Hellfire". The crazy life and times of Arthur Brown. Wembley 2006. ISBN: 0-946719-77-2.
(Carl Palmer was Arthur Brown's drummer from May 1968 until June 1970. Expected in December.)
Green, Jon: Promenade the Puzzle. The Poetic Vision of Peter Sinfield.
(About possible connections between King Crimson and emperor Friedrich II. This is an online article. Click here.)
newly added Plotczyk, S./ Smith, J.: Keith Emerson musical quote list sorted by composer.
III. In the making (can anyone confirm this?)
newly added Holm-Hudson, Kevin: Tell Mussorgsky the News: Emerson, Lake and Palmer's "Pictures at an Exhibition" as open work. Forthcoming.
Back to the Thematically sorted lists.
The young persons' guide to Progressive Rock books.
Desiderata.
Literary references in Progressive Rock.
Songbooks list.
My wants list.
Send me an e-mail: bibmaster{at}progbibliography.de
Go back .


text:
Home Brandon MacDill Air Force Base Commanders Join Brandon Chamber Synergy Luncheon
MacDill Air Force Base Commanders Join Brandon Chamber Synergy Luncheon
Tamas Mondovics
By Tamas Mondovics
Synergy, The Greater Brandon Chamber of Commerce's monthly membership luncheon, was pleased to welcome two special guests that provided insight to one of the most economically influential members of the Tampa Bay and surrounding area communities.
MacDill Air Force Base, Colonel Andre J. Briere, vice commander, 6th Air Mobility Wing, accompanied by Colonel Douglas J. Schwartz, Commander of the 927th Air Refueling Wing, at MacDill Air Force Base got a standing ovation as they were introduced to the large crowd gathered for the chambers monthly event held at The Regent located at 6437 Watson Rd. in Riverview.
Briere has flown more than 2,300 hours in a variety of aircraft in numerous combat and combat support missions in support of operations Southern Watch, Northern Watch, Provide Comfort, Restore Hope, Deny Flight, Allied Force, Enduring Freedom and Iraqi Freedom.
He currently assists the wing commander in leading more than 3,000 people, overseeing base property and capital assets totaling more than $2.8 billion, and controlling an annual budget exceeding $249 million.
Schwartz's responsibilities are equally impressive as he is currently responsible for the organization, training, equipping and worldwide readiness of a combined reserve and civilian wing of approximately 840 people. The 927th Air Refueling Wing flies the KC-135R Stratotanker whose missions consist of in-flight air refueling, cargo and passenger airlift, aeromedical evacuation and supporting contingencies and humanitarian operations around the world.
"The first key is time that we save, which translates into personnel and cost," Briere said. "We have to work smarter as we focus on efficiency, which is evident in the fact that the current workload is now met by half the amount of the workforce of active members compared to when I joined the air force."
Adding to the goal to be more productive and effective, MacDill is currently in the process of building a charter school as well as a hotel on base that are said to save millions of dollars annually.
For more information about The Brandon Chamber of Commerce, contact Christie Lemar at clemar@brandonchamber.com or call 689-1221 ext. 8812.
Previous articleMimi's Cafe Under New Management, Offers Wider Selection Of French Cuisine
Next articleAC Company Keeps Brandon Cool
https://www.ospreyobserver.com
Family Legacy Of Service Spans 200 Years And Continues With Children Who Continue To Serve
Suncoast Credit Union Presents The 2020 Winthrop Arts Annual Children's Art Show
Eye On Business; Brandon/Winthrop, December 2020


text:
Xu Guangqi (em chinês tradicional: 徐光啟) ou Paulo Siu ou ainda Paulo Xu (1562 - 1633) foi um letrado, mandarim, agrónomo, astrónomo e matemático chinês e católico na dinastia Ming.

Xu Guangqi fez uma carreira de sucesso na burocracia chinesa, tendo conseguido o cargo de primeiro-ministro. Ele converteu-se ao catolicismo em 1604 e, juntamente com Li Zhizao e Yan Tingyun, são considerados os "três grandes pilares do catolicismo chinês". Xu era um colega e apoiante dos jesuítas italianos Matteo Ricci, João da Rocha e Sabatino de Ursis. Ele colaborou na tradução de vários textos clássicos ocidentais na China, incluindo os Elementos de Euclides. Xu, tendo aprendido com os jesuítas os modernos conhecimentos astronómicos europeus, foi por isso nomeado pelo Imperador da China como o líder da reforma do calendário chinês. A reforma, que constituiu a primeira colaboração entre os principais cientistas da Europa e do Extremo Oriente, foi concluído somente após a sua morte.

Ver também
 Catolicismo na China
 Matteo Ricci

Ligações externas
Xu Guangqi: o Evangelho e a felicidade do Império

Políticos da China
Matemáticos da China
Matemáticos da China do século XVII
Igreja Católica na China

redpajama_set_name: RedPajamaWikipedia


Submitting the manuscript is always a big step in the publication journey. It's as true for submitting picture book manuscripts as anything else.
After two years of writing, revising, re-visioning, asking for feedback from other picture book authors, and more rewriting, I finally had a PB ms (Picture Book manuscript) I was proud of. I envisioned having my picture book appear on in book stores and libraries and being read to smiling children, everywhere. Of course, to accomplish this, I needed to take the next big step and submit my PB ms to agents and/or editors.
In anticipation of the submission process, I had already made a list of my top ten agents. I'd made another list of my top ten editors. Following directions and providing exactly what is specified is rule number one of querying/submitting. So, with hope in my heart, I went online to pull up each agent's and editor's submission requirements. Sadly, I discovered that my number one agent was closed to submissions.
For some reason, this gave me pause. Normally, I would have simply moved on to the next agent on the list, but I found that I had really had my heart set on this agent. After some consideration, I realized that this agency felt also right for me. So, I looked to see what other agents might be taking clients. Sadly, the answer was, none. One ray of hope peeked out at me, though, as the website stated that one of the agents (also someone I knew I could work with) would be open to submissions in January. It was late in the year and I thought, why not wait and submit to the agency I really wanted to work with. So, I waited.
On January 1, 2015, I mailed off my PB ms. Then, I went back to working on revisions for the novel I was writing. (I am always working on the next project.) After six weeks with no word, I went back online, only to discover the agent's list had not opened in January, after all. With some embarrassment, I emailed the agent to explain what had happened. I apologize for having jumped the gun. She was very kind and stated that, while she had not received the submission for some reason, she would be willing to take a look at the ms if I wished to send it via email.
No brainer for me. I sent it in. And, again, I waited.
I didn't have to wait long. However, her response was a very kind rejection in which she stated it wasn't really for her. She suggested I look at my work in dummy format to ensure the structure was solid and would fit one of the standard layouts.
I thanked her and did as she suggested. I toyed with both the 32- and 40-page layouts. I had done this before, but not with as much attention on structure and page placement. Suddenly, the relationship between the story structure and page layout started to click in ways it hadn't before. I also sought and received additional feedback from a friend, who is an amazing PB mentor. By now, I was feeling pretty good about the book, but it was already late spring. Things were gearing up for the SCBWI LA conference.
I decided it would be worth the wait to submit the ms for a critique in LA where I knew I would get valuable feedback on the project. This would help me to polish my story and ensure I would be submitting the best possible work when I began targeting the rest of the agents and editors on my list.
So, I shipped my fledgling picture book manuscript off to be critiqued. And, once more, I waited.


Learn the correct way to say Rottach Berg in its native language with our online pronunciation dictionary. Listen the name on our online audio dictionary and practice speaking Rottach Berg to sound like the native speaker of Spanish language.
Description: Rottach Berg is the name of a place in Germany.


text:
#include "tensorflow/compiler/xla/service/service.h"

#include <memory>
#include <string>
#include <utility>
#include <vector>

#include "absl/memory/memory.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
#include "tensorflow/compiler/xla/debug_options_flags.h"
#include "tensorflow/compiler/xla/execution_options_util.h"
#include "tensorflow/compiler/xla/layout_util.h"
#include "tensorflow/compiler/xla/service/compiler.h"
#include "tensorflow/compiler/xla/service/computation_layout.h"
#include "tensorflow/compiler/xla/service/device_memory_allocator.h"
#include "tensorflow/compiler/xla/service/dump.h"
#include "tensorflow/compiler/xla/service/dynamic_dimension_inference.h"
#include "tensorflow/compiler/xla/service/executable.h"
#include "tensorflow/compiler/xla/service/hlo_computation.h"
#include "tensorflow/compiler/xla/service/hlo_cost_analysis.h"
#include "tensorflow/compiler/xla/service/hlo_evaluator.h"
#include "tensorflow/compiler/xla/service/hlo_instruction.h"
#include "tensorflow/compiler/xla/service/hlo_module.h"
#include "tensorflow/compiler/xla/service/hlo_module_config.h"
#include "tensorflow/compiler/xla/service/hlo_proto_util.h"
#include "tensorflow/compiler/xla/service/platform_util.h"
#include "tensorflow/compiler/xla/service/source_map_util.h"
#include "tensorflow/compiler/xla/service/stream_pool.h"
#include "tensorflow/compiler/xla/service/transfer_manager.h"
#include "tensorflow/compiler/xla/shape.h"
#include "tensorflow/compiler/xla/shape_layout.h"
#include "tensorflow/compiler/xla/shape_util.h"
#include "tensorflow/compiler/xla/status_macros.h"
#include "tensorflow/compiler/xla/types.h"
#include "tensorflow/compiler/xla/util.h"
#include "tensorflow/compiler/xla/xla_data.pb.h"
#include "tensorflow/core/lib/gtl/cleanup.h"
#include "tensorflow/core/platform/env.h"
#include "tensorflow/core/platform/logging.h"
#include "tensorflow/core/platform/protobuf.h"
#include "tensorflow/core/platform/stream_executor_no_cuda.h"
#include "tensorflow/core/platform/types.h"
#include "tensorflow/core/util/ptr_util.h"

namespace xla {
namespace {

using absl::StrCat;
using absl::StrFormat;

// Argument used when calling DumpHloModuleIfEnabled before optimizations are
// performed on an HloModule.
constexpr char kBeforeOptimizationsDumpName[] = "before_optimizations";

// Records the arguments used to invoke a computation in an HloSnapshot proto.
Status RecordArguments(const absl::Span<const ShapedBuffer* const> arguments,
                       se::Stream* stream, TransferManager* transfer_manager,
                       HloSnapshot* module) {
  module->clear_arguments();
  for (const ShapedBuffer* argument : arguments) {
    TF_ASSIGN_OR_RETURN(
        Literal literal,
        transfer_manager->TransferLiteralFromDevice(stream, *argument));
    *module->add_arguments() = literal.ToProto();
  }
  return Status::OK();
}

// Records the result of a computation in a HloSnapshot proto.
Status RecordResult(const ShapedBuffer& result, se::Stream* stream,
                    TransferManager* transfer_manager, HloSnapshot* module) {
  module->clear_result();
  TF_ASSIGN_OR_RETURN(
      Literal literal,
      transfer_manager->TransferLiteralFromDevice(stream, result));
  *module->mutable_result() = literal.ToProto();
  return Status::OK();
}

}  // namespace

ServiceOptions& ServiceOptions::set_platform(se::Platform* platform) {
  platform_ = platform;
  return *this;
}

se::Platform* ServiceOptions::platform() const { return platform_; }

ServiceOptions& ServiceOptions::set_number_of_replicas(int number_of_replicas) {
  number_of_replicas_ = number_of_replicas;
  return *this;
}

int ServiceOptions::number_of_replicas() const { return number_of_replicas_; }

ServiceOptions& ServiceOptions::set_intra_op_parallelism_threads(
    int num_threads) {
  intra_op_parallelism_threads_ = num_threads;
  return *this;
}

int ServiceOptions::intra_op_parallelism_threads() const {
  return intra_op_parallelism_threads_;
}

ServiceOptions& ServiceOptions::set_allowed_devices(
    const absl::optional<std::set<int>>& allowed_devices) {
  allowed_devices_ = allowed_devices;
  return *this;
}

const absl::optional<std::set<int>>& ServiceOptions::allowed_devices() const {
  return allowed_devices_;
}

/* static */ StatusOr<std::unique_ptr<Service>> Service::NewService(
    se::Platform* platform) {
  ServiceOptions default_options;
  default_options.set_platform(platform);
  return NewService(default_options);
}

/* static */ StatusOr<std::unique_ptr<Service>> Service::NewService(
    const ServiceOptions& options) {
  se::Platform* platform = options.platform();
  std::unique_ptr<Backend> execute_backend;
  if (platform == nullptr) {
    TF_ASSIGN_OR_RETURN(platform, PlatformUtil::GetDefaultPlatform());
  }
  BackendOptions backend_options;
  backend_options.set_platform(platform);
  backend_options.set_allowed_devices(options.allowed_devices());
  TF_ASSIGN_OR_RETURN(execute_backend, Backend::CreateBackend(backend_options));

  std::unique_ptr<Service> service(
      new Service(options, std::move(execute_backend)));
  return std::move(service);
}

Service::Service(const ServiceOptions& options,
                 std::unique_ptr<Backend> execute_backend)
    : options_(options),
      allocation_tracker_(execute_backend.get()),
      execute_backend_(std::move(execute_backend)) {
  CHECK_GT(options_.number_of_replicas(), 0);
  if (execute_backend_) {
    if (execute_backend_->device_count() > 0) {
      CHECK_GE(execute_backend_->device_count(), options_.number_of_replicas())
          << "Requested more replicas than there are devices.";
    }
    LOG(INFO) << StrFormat(
        "XLA service %p executing computations on platform %s. Devices:", this,
        execute_backend_->platform()->Name());
    auto stream_executors = execute_backend_->stream_executors();
    for (int i = 0; i < execute_backend_->device_count(); ++i) {
      se::StreamExecutor* executor = stream_executors.at(i);
      const auto& description = executor->GetDeviceDescription();
      LOG(INFO) << StrFormat("  StreamExecutor device (%d): %s, %s", i,
                             description.name(),
                             description.platform_version());
    }
  } else {
    VLOG(1) << "XLA compile-only service constructed";
  }
}

Status Service::CreateChannelHandle(const CreateChannelHandleRequest* arg,
                                    CreateChannelHandleResponse* result) {
  TF_ASSIGN_OR_RETURN(*result->mutable_channel(),
                      channel_tracker_.NewChannel(arg->channel_type()));
  return Status::OK();
}

Status Service::Unregister(const UnregisterRequest* arg,
                           UnregisterResponse* result) {
  Status status;
  for (auto& data : arg->data()) {
    Status unregister_status = allocation_tracker_.Unregister(data);
    if (!unregister_status.ok() && status.ok()) {
      status = unregister_status;
    }
  }
  return status;
}

// Deconstructs a previously-allocated global handle.
Status Service::DeconstructTuple(const DeconstructTupleRequest* arg,
                                 DeconstructTupleResponse* result) {
  TF_ASSIGN_OR_RETURN(
      std::vector<GlobalDataHandle> elements,
      allocation_tracker_.DeconstructTuple(arg->tuple_handle()));

  for (auto& element : elements) {
    *result->add_element_handles() = element;
  }
  return Status::OK();
}

Status Service::ValidateResultShape(const Shape& client_shape,
                                    const Shape& result_shape) const {
  TF_RETURN_IF_ERROR(ShapeUtil::ValidateShapeWithOptionalLayout(client_shape));
  if (!ShapeUtil::Compatible(client_shape, result_shape)) {
    return InvalidArgument(
        "Shape used to set computation result layout %s is not compatible "
        "with result shape %s",
        ShapeUtil::HumanStringWithLayout(client_shape),
        ShapeUtil::HumanString(result_shape));
  }
  return Status::OK();
}

StatusOr<std::vector<std::vector<const ShapedBuffer*>>>
Service::ResolveAndValidateArguments(
    absl::Span<const GlobalDataHandle* const> arguments,
    absl::Span<se::StreamExecutor* const> stream_executors) const {
  CHECK_EQ(options_.number_of_replicas(), stream_executors.size());
  std::vector<std::vector<const ShapedBuffer*>> replicated_arguments;
  replicated_arguments.resize(options_.number_of_replicas());
  for (size_t i = 0; i < arguments.size(); ++i) {
    auto buffer_status = allocation_tracker_.Resolve(*arguments[i]);
    if (!buffer_status.ok()) {
      return Status(buffer_status.status().code(),
                    StrCat(buffer_status.status().error_message(), ", ",
                           "failed to resolve allocation for parameter ", i));
    }
    auto replicated_buffers = buffer_status.ValueOrDie();
    CHECK_EQ(options_.number_of_replicas(), replicated_buffers.size());
    for (int replica = 0; replica < options_.number_of_replicas(); ++replica) {
      const ShapedBuffer* shaped_buffer = replicated_buffers[replica];
      int replica_device_ordinal = stream_executors[replica]->device_ordinal();
      // Verify allocation is same platform and device as the execution.
      if (shaped_buffer->platform() != execute_backend_->platform() ||
          shaped_buffer->device_ordinal() != replica_device_ordinal) {
        return InvalidArgument(
            "argument %lu is on device %s:%d but computation will be executed "
            "on device %s",
            i, shaped_buffer->platform()->Name(),
            shaped_buffer->device_ordinal(),
            execute_backend_->device_name(replica_device_ordinal));
      }
      replicated_arguments[replica].push_back(shaped_buffer);
    }
  }
  return replicated_arguments;
}

StatusOr<std::unique_ptr<HloModuleConfig>> Service::CreateModuleConfig(
    const ProgramShape& program_shape,
    absl::Span<const Shape* const> argument_shapes,
    const ExecutionOptions* execution_options) {
  auto config = absl::make_unique<HloModuleConfig>(program_shape);
  ComputationLayout* computation_layout =
      config->mutable_entry_computation_layout();
  if (program_shape.parameters_size() != argument_shapes.size()) {
    return InvalidArgument("computation takes %d parameters, but %u given",
                           program_shape.parameters_size(),
                           argument_shapes.size());
  }
  for (int i = 0; i < argument_shapes.size(); ++i) {
    // Verify that shape of arguments matches the shape of the arguments in the
    // ProgramShape.
    if (!ShapeUtil::Compatible(*argument_shapes[i],
                               program_shape.parameters(i))) {
      return InvalidArgument(
          "Argument does not match shape of computation parameter %d: want "
          "%s, got %s",
          i, ShapeUtil::HumanString(program_shape.parameters(i)),
          ShapeUtil::HumanString(*argument_shapes[i]));
    }
    TF_RETURN_IF_ERROR(
        computation_layout->mutable_parameter_layout(i)->CopyLayoutFromShape(
            *argument_shapes[i]));
  }
  if (execution_options != nullptr &&
      execution_options->has_shape_with_output_layout()) {
    const Shape shape_with_output_layout(
        execution_options->shape_with_output_layout());
    TF_RETURN_IF_ERROR(
        ValidateResultShape(shape_with_output_layout, program_shape.result()));
    TF_RETURN_IF_ERROR(
        computation_layout->mutable_result_layout()->CopyLayoutFromShape(
            shape_with_output_layout));
  } else {
    // If the result layout is not set, then choose the default.
    computation_layout->mutable_result_layout()->SetToDefaultLayout();
  }

  if (execution_options != nullptr) {
    if (execution_options->num_replicas() > 0) {
      config->set_replica_count(execution_options->num_replicas());
    } else {
      config->set_replica_count(options_.number_of_replicas());
    }
    config->set_seed(execution_options->seed());
    config->set_debug_options(execution_options->debug_options());
  } else {
    config->set_replica_count(options_.number_of_replicas());
    config->set_debug_options(GetDebugOptionsFromFlags());
  }

  if (execute_backend_ != nullptr &&
      execute_backend_->eigen_intra_op_thread_pool() != nullptr) {
    config->set_intra_op_parallelism_threads(
        execute_backend_->eigen_intra_op_thread_pool()->NumThreads());
  }
  return std::move(config);
}

StatusOr<std::unique_ptr<HloModuleConfig>> Service::CreateModuleConfig(
    const ProgramShape& program_shape,
    absl::Span<const ShapedBuffer* const> arguments,
    const ExecutionOptions& execution_options) {
  std::vector<const Shape*> argument_shapes;
  for (const auto* arg : arguments) {
    argument_shapes.push_back(&arg->on_host_shape());
  }
  return CreateModuleConfig(program_shape, argument_shapes, &execution_options);
}

StatusOr<std::vector<std::unique_ptr<Executable>>> Service::BuildExecutables(
    const std::vector<const HloModuleProto*>& module_protos,
    std::vector<std::unique_ptr<HloModuleConfig>> module_configs,
    Backend* backend, std::vector<std::vector<se::StreamExecutor*>> executors,
    DeviceMemoryAllocator* device_allocator) {
  VLOG(1) << StrFormat("BuildExecutable on service %p", this);

  // Dump computation proto state if flag is set.
  std::vector<std::unique_ptr<HloSnapshot>> hlo_snapshots;
  for (int64 i = 0; i < module_protos.size(); ++i) {
    auto hlo_snapshot = absl::make_unique<HloSnapshot>();
    *hlo_snapshot->mutable_hlo()->mutable_hlo_module() = *module_protos[i];
    hlo_snapshots.push_back(std::move(hlo_snapshot));
  }

  VLOG(1) << "Computations:";
  for (const HloModuleProto* proto : module_protos) {
    VLOG(1) << proto->name();
  }

  CHECK_EQ(module_protos.size(), module_configs.size());
  auto module_group =
      absl::make_unique<HloModuleGroup>(module_protos[0]->name());
  for (int64 i = 0; i < module_protos.size(); ++i) {
    const HloModuleProto* proto = module_protos[i];
    const HloModuleConfig& config = *module_configs[i];
    TF_ASSIGN_OR_RETURN(auto module, CreateModuleFromProto(*proto, config));
    DumpHloModuleIfEnabled(*module, kBeforeOptimizationsDumpName);
    module_group->push_back(std::move(module));
  }

  TF_ASSIGN_OR_RETURN(
      std::vector<std::unique_ptr<Executable>> executables,
      backend->compiler()->Compile(std::move(module_group),
                                   std::move(executors), device_allocator));

  for (size_t i = 0; i < module_protos.size(); ++i) {
    const auto& debug_opts = module_configs[i]->debug_options();
    if (DumpingEnabledForHloModule(module_protos[i]->name(), debug_opts) &&
        debug_opts.xla_dump_hlo_snapshots()) {
      executables[i]->set_hlo_snapshot(std::move(hlo_snapshots[i]));
    }
  }

  return std::move(executables);
}

StatusOr<std::vector<GlobalDataHandle>>
Service::ExecuteParallelAndRegisterResult(
    absl::Span<Executable* const> executables,
    absl::Span<const std::vector<std::vector<const ShapedBuffer*>>> arguments,
    Backend* backend, absl::Span<const DeviceHandle> device_handles,
    absl::Span<const string> result_tags, ExecutionProfile* profile) {
  // Streams where the computation are launched, so we can wait on the streams
  // to complete.
  std::vector<StreamPool::Ptr> streams;
  std::vector<std::unique_ptr<se::Timer>> timers;

  // Global data handles for the computation results, one for each computation.
  std::vector<GlobalDataHandle> result_handles;

  // Device ID to stream executor, populated only with devices that are being
  // profiled.
  std::map<int64, se::Stream*> index_to_profiled_streams;

  // Build DeviceAssignment for all cores based on the provided device handles.
  DeviceAssignment device_assignment(options_.number_of_replicas(),
                                     executables.size());
  for (int64 i = 0; i < executables.size(); i++) {
    TF_ASSIGN_OR_RETURN(auto replicas, Replicas(*backend, device_handles[i]));
    CHECK_EQ(replicas.size(), arguments[i].size());
    for (int64 replica = 0; replica < replicas.size(); ++replica) {
      device_assignment(replica, i) = replicas[replica]->device_ordinal();
    }
  }

  for (int64 i = 0; i < executables.size(); i++) {
    // Stream executors for the replicas of the current computation.
    TF_ASSIGN_OR_RETURN(auto replicas, Replicas(*backend, device_handles[i]));
    CHECK_EQ(replicas.size(), arguments[i].size());
    std::vector<ScopedShapedBuffer> result_buffers;
    for (int64 replica = 0; replica < replicas.size(); ++replica) {
      TF_ASSIGN_OR_RETURN(StreamPool::Ptr stream,
                          backend->BorrowStream(replicas[replica]));
      streams.push_back(std::move(stream));

      if (replica == 0 && profile != nullptr) {
        timers.push_back(
            absl::make_unique<se::Timer>(streams.back()->parent()));
        streams.back()
            ->InitTimer(timers.back().get())
            .ThenStartTimer(timers.back().get());
        CHECK(timers.front() != nullptr);
      }

      if (replica == 0 &&
          executables[i]->module_config().debug_options().xla_hlo_profile() &&
          executables[i]->hlo_profiling_enabled()) {
        index_to_profiled_streams[i] = streams.back().get();
      }

      // Set up run options.
      ExecutableRunOptions options;
      options.set_stream(streams.back().get());
      options.set_allocator(backend->memory_allocator());
      options.set_intra_op_thread_pool(
          backend->eigen_intra_op_thread_pool_device());
      options.set_device_assignment(&device_assignment);
      ServiceExecutableRunOptions run_options(options,
                                              backend->StreamBorrower());

      // Asynchronously launch the computation.
      TF_ASSIGN_OR_RETURN(ScopedShapedBuffer result,
                          executables[i]->ExecuteAsyncOnStream(
                              &run_options, arguments[i][replica]));

      if (replica == 0 && profile != nullptr) {
        streams.back()->ThenStopTimer(timers.back().get());
      }

      result_buffers.push_back(std::move(result));
    }
    TF_ASSIGN_OR_RETURN(GlobalDataHandle handle,
                        allocation_tracker_.RegisterReplicatedBuffers(
                            std::move(result_buffers), result_tags[i]));
    result_handles.push_back(handle);
  }

  // Wait for all executions to complete.
  for (int64 i = 0; i < streams.size(); ++i) {
    Status block_status = streams[i]->BlockHostUntilDone();
    if (!block_status.ok()) {
      return InternalError("failed to complete execution for stream %d: %s", i,
                           block_status.error_message());
    }
  }

  if (profile != nullptr) {
    CHECK(!timers.empty());
    std::vector<uint64> timer_nanoseconds;
    timer_nanoseconds.reserve(timers.size());
    for (auto& timer : timers) {
      timer_nanoseconds.push_back(timer->Nanoseconds());
    }
    uint64 nanoseconds =
        *std::max_element(timer_nanoseconds.begin(), timer_nanoseconds.end());

    // Merge in run-time profile information from execution_profile on the
    // zeroth device.
    profile->MergeFrom(executables[0]->execution_profile());

    // Overall execution time (in nanoseconds) from the executor timer.
    profile->set_compute_and_transfer_time_ns(nanoseconds);

    // TODO(b/28123297): On GPU we end up including transfer time in
    // the compute time this way. Instead, we should get the correct
    // value by measuring it. Setting the field here at least lets
    // benchmarks provide *some* value for GPU computations.
    //
    // TODO(b/28447609): The value in compute_and_transfer_time_ns is actually
    // the compute time without the transfer time, so this way we get the
    // correct compute time. We should instead have the correct value for
    // compute_and_transfer_time and set compute_time to the compute time.
    if (profile->compute_time_ns() == 0) {
      profile->set_compute_time_ns(profile->compute_and_transfer_time_ns());
    }
  }

  return result_handles;
}

StatusOr<GlobalDataHandle> Service::ExecuteAndRegisterResult(
    Executable* executable,
    absl::Span<const std::vector<const ShapedBuffer*>> arguments,
    Backend* backend, const DeviceHandle& device_handle,
    const string& result_tag, ExecutionProfile* profile) {
  // Set up streams.
  std::vector<StreamPool::Ptr> streams;

  TF_ASSIGN_OR_RETURN(auto replicas, Replicas(*backend, device_handle));
  TF_RET_CHECK(!replicas.empty());
  for (se::StreamExecutor* executor : replicas) {
    TF_ASSIGN_OR_RETURN(StreamPool::Ptr stream,
                        backend->BorrowStream(executor));
    streams.push_back(std::move(stream));
  }

  DeviceAssignment device_assignment(options_.number_of_replicas(),
                                     /*computation_count=*/1);
  for (int64 replica = 0; replica < replicas.size(); ++replica) {
    device_assignment(replica, 0) = replicas[replica]->device_ordinal();
  }

  // Set up run options.
  std::vector<ServiceExecutableRunOptions> run_options;
  for (const StreamPool::Ptr& stream : streams) {
    ExecutableRunOptions options;
    options.set_stream(stream.get());
    options.set_device_ordinal(stream->parent()->device_ordinal());
    options.set_allocator(backend->memory_allocator());
    options.set_intra_op_thread_pool(
        backend->eigen_intra_op_thread_pool_device());
    options.set_device_assignment(&device_assignment);
    run_options.emplace_back(options, backend->StreamBorrower());
  }

  if (options_.number_of_replicas() == 1) {
    TF_ASSIGN_OR_RETURN(
        auto result, executable->ExecuteOnStreamWrapper(&run_options[0],
                                                        profile, arguments[0]));
    return allocation_tracker_.Register(std::move(result), result_tag);
  }

  // TODO(b/69985541): Support profiling also on this path.

  std::vector<absl::Span<const ShapedBuffer* const>> replicated_arguments;
  for (const auto& arg : arguments) {
    replicated_arguments.push_back(arg);
  }

  TF_ASSIGN_OR_RETURN(auto results, executable->ExecuteOnStreams(
                                        run_options, replicated_arguments));
  TF_RET_CHECK(!results.empty());
  return allocation_tracker_.RegisterReplicatedBuffers(std::move(results),
                                                       result_tag);
}

StatusOr<std::vector<se::StreamExecutor*>> Service::GetExecutors(
    const ExecutionOptions& execution_options, int64 requests_size,
    int64 request_index) const {
  if (execution_options.device_handles().empty()) {
    return FailedPrecondition(
        "device handles must be given to execute parallel computations");
  }
  if (requests_size > 1 && execution_options.device_handles_size() > 1) {
    return InvalidArgument(
        "Parallel requests with multiple device handles is not supported. "
        "Found %d parallel requests, with request %d containing %d device "
        "handles.",
        requests_size, request_index, execution_options.device_handles_size());
  }
  std::vector<se::StreamExecutor*> executors;
  for (const auto& device_handle : execution_options.device_handles()) {
    TF_ASSIGN_OR_RETURN(auto replicas,
                        Replicas(*execute_backend_, device_handle));
    se::StreamExecutor* executor = replicas[0];
    CHECK(executor != nullptr);
    executors.push_back(executor);
  }
  return executors;
}

StatusOr<std::vector<std::vector<const ShapedBuffer*>>> Service::GetArguments(
    const ExecutionOptions& execution_options,
    absl::Span<const GlobalDataHandle* const> arguments) const {
  // Resolve the allocations for the arguments of the computation, and create
  // a vector of device memory offsets for the arguments from the allocations.
  // In the case of partitioned computations, assume all arguments go on the
  // zeroth core.
  TF_ASSIGN_OR_RETURN(
      auto replicas,
      Replicas(*execute_backend_, execution_options.device_handles(0)));
  TF_ASSIGN_OR_RETURN(
      std::vector<std::vector<const ShapedBuffer*>> replicated_arguments,
      ResolveAndValidateArguments(arguments, replicas));
  return replicated_arguments;
}

Status Service::ExecuteGraphParallel(const ExecuteGraphParallelRequest* arg,
                                     ExecuteParallelResponse* result) {
  VLOG(1) << "running execute-graph-parallel request";

  std::vector<std::vector<std::vector<const ShapedBuffer*>>> all_arguments;
  std::vector<std::vector<se::StreamExecutor*>> all_executors;
  std::vector<const HloModuleProto*> module_protos;
  std::vector<std::unique_ptr<HloModuleConfig>> module_configs;
  std::vector<string> computation_names;
  std::vector<DeviceHandle> device_handles;

  int num_requested_devices =
      std::accumulate(arg->requests().begin(), arg->requests().end(), 0,
                      [](int a, const ExecuteGraphRequest& r) -> int {
                        return a + r.execution_options().device_handles_size();
                      });
  if (num_requested_devices * options_.number_of_replicas() >
      execute_backend_->device_count()) {
    return FailedPrecondition(
        "there are not enough stream executors to execute %d computations",
        num_requested_devices);
  }

  for (int64 i = 0; i < arg->requests_size(); ++i) {
    // Get the stream executor for the i'th computation. This stream executor
    // is one of the executors to run the replicated computation.
    const ExecutionOptions& execution_options =
        arg->requests(i).execution_options();
    const ExecuteGraphRequest& request = arg->requests(i);
    TF_RET_CHECK(request.has_computation()) << "computations may not be empty";
    TF_RET_CHECK(request.computation().has_host_program_shape())
        << "programe shape may not be empty";

    // Get the executors.
    TF_ASSIGN_OR_RETURN(auto executors, GetExecutors(execution_options,
                                                     arg->requests_size(), i));

    // Get the replicated arguments.
    TF_ASSIGN_OR_RETURN(auto replicated_arguments,
                        GetArguments(execution_options, request.arguments()));

    // Create an HloModuleConfig object for the computation, given the shape of
    // the program and the argument allocations. Here, we care only about the
    // shapes of the arguments, so, it is sufficient to use the arguments of
    // replica 0.
    TF_ASSIGN_OR_RETURN(
        std::unique_ptr<HloModuleConfig> module_config,
        CreateModuleConfig(
            ProgramShape{request.computation().host_program_shape()},
            replicated_arguments.front(), request.execution_options()));
    VLOG(3)
        << "ExecuteGraphParallel created HloModuleConfig computation layout: "
        << module_config->entry_computation_layout().ToString();

    // Adds to the vectors to build and execute the computations after the loop.
    all_arguments.push_back(replicated_arguments);
    all_arguments.insert(all_arguments.end(), executors.size() - 1, {{}});
    module_protos.push_back(&request.computation());
    module_configs.push_back(std::move(module_config));
    computation_names.insert(computation_names.end(), executors.size(),
                             request.computation().name());
    all_executors.push_back(executors);
    device_handles.insert(device_handles.end(),
                          execution_options.device_handles().begin(),
                          execution_options.device_handles().end());
  }

  // Build the HloModules and compile to generate the executables.
  //
  // TODO(jlebar): There's currently no way to pass a device allocator to
  // ExecuteGraphParallel, so we have to pass a null device_allocator below.
  TF_ASSIGN_OR_RETURN(std::vector<std::unique_ptr<Executable>> executables,
                      BuildExecutables(module_protos, std::move(module_configs),
                                       execute_backend_.get(), all_executors,
                                       /*device_allocator=*/nullptr));
  std::vector<Executable*> executable_ptrs;
  executable_ptrs.reserve(executables.size());
  for (const auto& executable : executables) {
    executable_ptrs.push_back(executable.get());
  }

  for (int i = 0; i < executable_ptrs.size(); i++) {
    if (executable_ptrs[i]->dumping_snapshot()) {
      TF_ASSIGN_OR_RETURN(auto stream,
                          execute_backend_->BorrowStream(
                              all_executors[i][0]->device_ordinal()));
      TF_RETURN_IF_ERROR(RecordArguments(all_arguments[i].front(), stream.get(),
                                         execute_backend_->transfer_manager(),
                                         executable_ptrs[i]->hlo_snapshot()));
    }
  }

  // If we have multiple executables to run, execute them all in parallel.  But
  // if we only have one executable, execute it using the vanilla, non-parallel
  // call.
  //
  // We do this because the Client API uses ExecuteGraphParallel when it wants
  // to compile and run one computation without caching the executable, but not
  // all backends support the async StreamExecutor API required by
  // ExecuteParallelAndRegisterResult.
  //
  // TODO(b/122731460): Consolidate Execute{,Parallel}AndRegisterResult; they do
  // basically the same thing.
  ExecutionProfile profile;
  std::vector<GlobalDataHandle> outputs;
  if (executable_ptrs.size() == 1) {
    TF_ASSIGN_OR_RETURN(
        auto output,
        ExecuteAndRegisterResult(executable_ptrs[0], all_arguments[0],
                                 execute_backend_.get(), device_handles[0],
                                 computation_names[0], &profile));
    outputs.push_back(std::move(output));
  } else {
    TF_ASSIGN_OR_RETURN(
        outputs, ExecuteParallelAndRegisterResult(
                     executable_ptrs, all_arguments, execute_backend_.get(),
                     device_handles, computation_names, &profile));
  }

  for (const GlobalDataHandle& output : outputs) {
    ExecuteResponse response;
    *response.mutable_output() = output;
    *response.mutable_profile() = profile;
    *result->add_responses() = response;
  }

  for (int i = 0; i < executable_ptrs.size(); i++) {
    Executable* executable = executable_ptrs[i];
    if (executable->dumping_snapshot()) {
      TF_ASSIGN_OR_RETURN(const ShapedBuffer* result_buffer,
                          allocation_tracker_.ResolveForReplica(outputs[i], 0));
      TF_ASSIGN_OR_RETURN(auto stream,
                          execute_backend_->BorrowStream(all_executors[i][0]));
      TF_RETURN_IF_ERROR(RecordResult(*result_buffer, stream.get(),
                                      execute_backend_->transfer_manager(),
                                      executable->hlo_snapshot()));
      DumpHloSnapshotIfEnabled(executable->module(),
                               *executable->hlo_snapshot());
    }
  }

  VLOG(1) << "successfully completed 'execute-graph-parallel' request";
  return Status::OK();
}

Status Service::GetDeviceHandles(const GetDeviceHandlesRequest* arg,
                                 GetDeviceHandlesResponse* result) {
  const int64 available_device_count = execute_backend_->device_count();
  const int64 replica_count = options_.number_of_replicas();
  if (replica_count <= 0) {
    return FailedPrecondition("Replica count must be a positive integer");
  }
  if (available_device_count < arg->device_count() * replica_count) {
    return ResourceExhausted(
        "Requested logical device count (%d) with replica count (%d) exceeds "
        "the number of available physical devices on the target (%d)",
        arg->device_count(), replica_count, available_device_count);
  }

  for (int64 i = 0; i < arg->device_count(); ++i) {
    DeviceHandle device_handle;
    device_handle.set_handle(i);
    device_handle.set_device_count(arg->device_count());
    *result->add_device_handles() = device_handle;
  }

  return Status::OK();
}

StatusOr<std::unique_ptr<Executable>> Service::BuildExecutable(
    const HloModuleProto& module_proto,
    std::unique_ptr<HloModuleConfig> module_config, Backend* backend,
    se::StreamExecutor* executor, DeviceMemoryAllocator* device_allocator) {
  VLOG(1) << StrFormat(
      "BuildExecutable on service %p with serialized module proto: %s", this,
      module_proto.name());

  TF_ASSIGN_OR_RETURN(std::unique_ptr<HloModule> module,
                      CreateModuleFromProto(module_proto, *module_config));
  DumpHloModuleIfEnabled(*module, kBeforeOptimizationsDumpName);

  TF_ASSIGN_OR_RETURN(
      module, backend->compiler()->RunHloPasses(std::move(module), executor,
                                                device_allocator));

  TF_ASSIGN_OR_RETURN(std::unique_ptr<Executable> executable,
                      backend->compiler()->RunBackend(
                          std::move(module), executor, device_allocator));

  const auto& debug_opts = module_config->debug_options();
  if (DumpingEnabledForHloModule(module_proto.name(), debug_opts) &&
      debug_opts.xla_dump_hlo_snapshots()) {
    auto hlo_snapshot = absl::make_unique<HloSnapshot>();
    *hlo_snapshot->mutable_hlo()->mutable_hlo_module() = module_proto;
    executable->set_hlo_snapshot(std::move(hlo_snapshot));
  }

  return std::move(executable);
}

Status Service::Compile(const CompileRequest* arg, CompileResponse* result) {
  VLOG(1) << "running compile request";
  if (!arg->has_computation()) {
    return InvalidArgument("computations may not be empty");
  }
  if (!arg->computation().has_host_program_shape()) {
    return InvalidArgument("programe shape may not be empty");
  }

  if (arg->execution_options().device_handles_size() > 1) {
    return InvalidArgument(
        "The compile request does not support multiple device handles.");
  }

  std::vector<Shape> argument_shapes;
  argument_shapes.reserve(arg->input_shape_with_layout_size());
  std::vector<const Shape*> argument_shape_ptrs;
  for (const ShapeProto& shape_proto : arg->input_shape_with_layout()) {
    argument_shapes.push_back(Shape(shape_proto));
    argument_shape_ptrs.push_back(&argument_shapes.back());
  }
  TF_ASSIGN_OR_RETURN(
      std::unique_ptr<HloModuleConfig> module_config,
      CreateModuleConfig(ProgramShape{arg->computation().host_program_shape()},
                         argument_shape_ptrs, &arg->execution_options()));
  VLOG(3) << "Compile created HloModuleConfig computation layout: "
          << module_config->entry_computation_layout().ToString();

  TF_ASSIGN_OR_RETURN(
      std::unique_ptr<Executable> executable,
      BuildExecutable(arg->computation(), std::move(module_config),
                      execute_backend_.get(),
                      execute_backend_->default_stream_executor(),
                      /*device_allocator=*/nullptr));

  *result->mutable_handle() = compilation_cache_.Insert(std::move(executable));

  VLOG(1) << "successfully completed 'compile' request";
  return Status::OK();
}

Status Service::Execute(const ExecuteRequest* arg, ExecuteResponse* result) {
  VLOG(1) << "running execute request";
  if (!arg->has_handle()) {
    return InvalidArgument("execution handle should not be empty");
  }
  TF_ASSIGN_OR_RETURN(auto executable,
                      compilation_cache_.LookUp(arg->handle()));

  TF_ASSIGN_OR_RETURN(auto replicas, Replicas(*execute_backend_,
                                              SingleComputationDeviceHandle()));
  TF_ASSIGN_OR_RETURN(
      std::vector<std::vector<const ShapedBuffer*>> replicated_arguments,
      ResolveAndValidateArguments(arg->arguments(), replicas));

  // Check that the replicated_arguments has the same shape and layout as the
  // module config used when creating the exectuable.
  const int64 num_module_args =
      executable->module_config().entry_computation_layout().parameter_count();
  if (num_module_args != arg->arguments_size()) {
    return InvalidArgument(
        "The executable expects %lld arguments, but sees %lld.",
        num_module_args, arg->arguments_size());
  }
  for (int64 i = 0; i < num_module_args; i++) {
    const Shape& shape_module =
        executable->module_config().entry_computation_layout().parameter_shape(
            i);
    const Shape& shape_arg = replicated_arguments.front()[i]->on_host_shape();
    if (!ShapeUtil::Equal(shape_module, shape_arg)) {
      return InvalidArgumentStrCat(
          "The executable exepcts the ", i, "th argument in shape ",
          ShapeUtil::HumanStringWithLayout(shape_module), " but sees ",
          ShapeUtil::HumanStringWithLayout(shape_arg));
    }
  }

  TF_ASSIGN_OR_RETURN(auto stream,
                      execute_backend_->BorrowStream(
                          execute_backend_->default_stream_executor()));
  if (executable->dumping_snapshot()) {
    executable->hlo_snapshot()->set_execution_platform(
        execute_backend_->platform()->Name());
    TF_RETURN_IF_ERROR(RecordArguments(
        replicated_arguments.front(), stream.get(),
        execute_backend_->transfer_manager(), executable->hlo_snapshot()));
  }

  TF_ASSIGN_OR_RETURN(
      *result->mutable_output(),
      ExecuteAndRegisterResult(executable.get(), replicated_arguments,
                               execute_backend_.get(),
                               SingleComputationDeviceHandle(),
                               "result of " + executable->module().name(),
                               result->mutable_profile()));

  if (executable->dumping_snapshot()) {
    TF_ASSIGN_OR_RETURN(
        const ShapedBuffer* result_buffer,
        allocation_tracker_.ResolveForReplica(result->output(), 0));
    TF_RETURN_IF_ERROR(RecordResult(*result_buffer, stream.get(),
                                    execute_backend_->transfer_manager(),
                                    executable->hlo_snapshot()));
    DumpHloSnapshotIfEnabled(executable->module(), *executable->hlo_snapshot());
  }

  VLOG(1) << "successfully completed 'execute' request";
  return Status::OK();
}

Status Service::WaitForExecution(const WaitForExecutionRequest* arg,
                                 WaitForExecutionResponse* result) {
  TF_ASSIGN_OR_RETURN(const auto execution,
                      execution_tracker_.Resolve(arg->execution()));

  TF_RETURN_IF_ERROR(execution->BlockUntilDone());

  *result->mutable_output() = execution->result();
  *result->mutable_profile() = execution->profile();

  TF_RETURN_IF_ERROR(execution_tracker_.Unregister(arg->execution()));
  VLOG(1) << "successfully completed 'wait-for-execution' request";
  return Status::OK();
}

Status Service::TransferToClient(const TransferToClientRequest* arg,
                                 TransferToClientResponse* result) {
  TF_ASSIGN_OR_RETURN(const ShapedBuffer* shaped_buffer,
                      allocation_tracker_.ResolveForReplica(arg->data(), 0));

  Shape return_shape;
  if (arg->has_shape_with_layout()) {
    return_shape = Shape(arg->shape_with_layout());
    if (!LayoutUtil::HasLayout(return_shape)) {
      return InvalidArgument("shape_with_layout must have layout if present.");
    }
  } else {
    return_shape = Shape(shaped_buffer->on_host_shape());
  }

  TF_ASSIGN_OR_RETURN(auto stream, execute_backend_->BorrowStream(
                                       shaped_buffer->device_ordinal()));

  TF_ASSIGN_OR_RETURN(
      Literal result_literal,
      execute_backend_->transfer_manager()->TransferLiteralFromDevice(
          stream.get(), *shaped_buffer));

  if (LayoutUtil::LayoutsInShapesEqual(return_shape, result_literal.shape())) {
    *result->mutable_literal() = result_literal.ToProto();
  } else {
    *result->mutable_literal() =
        result_literal.Relayout(return_shape).ToProto();
  }
  return Status::OK();
}

Status Service::TransferToServer(const TransferToServerRequest* arg,
                                 TransferToServerResponse* result) {
  TF_ASSIGN_OR_RETURN(Literal literal,
                      Literal::CreateFromProto(arg->literal()));
  const Shape& shape = literal.shape();

  std::vector<se::StreamExecutor*> replicas;
  if (arg->has_device_handle()) {
    TF_ASSIGN_OR_RETURN(replicas,
                        Replicas(*execute_backend_, arg->device_handle()));
  } else {
    TF_ASSIGN_OR_RETURN(
        replicas, Replicas(*execute_backend_, SingleComputationDeviceHandle()));
  }

  // Allocate memory in each replica and transfer the data to all replicas.
  std::vector<ScopedShapedBuffer> replicated_buffers;
  for (se::StreamExecutor* executor : replicas) {
    TF_ASSIGN_OR_RETURN(
        ScopedShapedBuffer shaped_buffer,
        execute_backend_->transfer_manager()->AllocateScopedShapedBuffer(
            shape, execute_backend_->memory_allocator(),
            executor->device_ordinal()));
    TF_ASSIGN_OR_RETURN(auto stream, execute_backend_->BorrowStream(executor));
    TF_RETURN_IF_ERROR(
        execute_backend_->transfer_manager()->TransferLiteralToDevice(
            stream.get(), literal, shaped_buffer));
    replicated_buffers.emplace_back(std::move(shaped_buffer));
  }
  TF_ASSIGN_OR_RETURN(*result->mutable_data(),
                      allocation_tracker_.RegisterReplicatedBuffers(
                          std::move(replicated_buffers),
                          StrCat("TransferToServer literal of shape ",
                                 ShapeUtil::HumanString(shape))));

  return Status::OK();
}

Status Service::TransferToInfeed(const TransferToInfeedRequest* arg,
                                 TransferToInfeedResponse* result) {
  const int64 replica_count = options_.number_of_replicas();
  if (arg->replica_id() < 0 || arg->replica_id() >= replica_count) {
    return FailedPrecondition(
        "%s",
        StrCat("The replica_id=", arg->replica_id(),
               " on TransferToInfeedRequest not in range [0, replica_count=",
               replica_count, ")."));
  }

  se::StreamExecutor* executor;
  if (arg->has_device_handle()) {
    TF_ASSIGN_OR_RETURN(auto replicas,
                        Replicas(*execute_backend_, arg->device_handle()));
    executor = replicas[arg->replica_id()];
  } else {
    TF_ASSIGN_OR_RETURN(
        auto replicas,
        Replicas(*execute_backend_, SingleComputationDeviceHandle()));
    executor = replicas[arg->replica_id()];
  }

  TF_ASSIGN_OR_RETURN(Literal literal,
                      Literal::CreateFromProto(arg->literal()));
  return execute_backend_->transfer_manager()->TransferLiteralToInfeed(executor,
                                                                       literal);
}

Status Service::TransferFromOutfeed(const TransferFromOutfeedRequest* arg,
                                    TransferFromOutfeedResponse* result) {
  const int64 replica_count = options_.number_of_replicas();
  if (arg->replica_id() < 0 || arg->replica_id() >= replica_count) {
    return FailedPrecondition(
        "The replica_id=%d on TransferFromOutfeedRequest not in range [0, %d)",
        arg->replica_id(), replica_count);
  }

  se::StreamExecutor* executor;
  if (arg->has_device_handle()) {
    TF_ASSIGN_OR_RETURN(auto replicas,
                        Replicas(*execute_backend_, arg->device_handle()));
    executor = replicas[arg->replica_id()];
  } else {
    TF_ASSIGN_OR_RETURN(
        auto replicas,
        Replicas(*execute_backend_, SingleComputationDeviceHandle()));
    executor = replicas[arg->replica_id()];
  }

  auto literal = Literal::CreateFromShape(Shape(arg->shape_with_layout()));

  TF_RETURN_IF_ERROR(
      execute_backend_->transfer_manager()->TransferLiteralFromOutfeed(
          executor, Shape(arg->shape_with_layout()), literal));
  *result->mutable_literal() = literal.ToProto();
  return Status::OK();
}

Status Service::ResetDevice(const ResetDeviceRequest* arg,
                            ResetDeviceResponse* result) {
  return execute_backend_->ResetDevices();
}

Status Service::ComputeConstantGraph(const ComputeConstantGraphRequest* arg,
                                     ComputeConstantResponse* result) {
  if (!arg->has_computation()) {
    return InvalidArgument("computations may not be empty");
  }
  if (!arg->computation().has_host_program_shape()) {
    return InvalidArgument("program shape may not be empty");
  }
  if (arg->computation().host_program_shape().parameters_size() != 0) {
    return InvalidArgument(
        "constant computation may not depend on any parameters.");
  }

  ProgramShape program_shape(arg->computation().host_program_shape());
  TF_DCHECK_OK(ShapeUtil::ValidateShape(program_shape.result()));
  absl::optional<Layout> output_layout;
  if (arg->has_output_layout()) {
    output_layout = Layout::CreateFromProto(arg->output_layout());
    TF_RETURN_IF_ERROR(LayoutUtil::ValidateLayoutForShape(
        *output_layout, program_shape.result()));
  }

  HloModuleConfig config(program_shape);

  TF_ASSIGN_OR_RETURN(std::unique_ptr<HloModule> module,
                      CreateModuleFromProto(arg->computation(), config));

  TF_ASSIGN_OR_RETURN(DynamicDimensionInference dynamic_dimension_inference,
                      DynamicDimensionInference::Run(module.get()));

  HloEvaluator evaluator;
  evaluator.set_dynamic_dimension_inference(&dynamic_dimension_inference);
  TF_ASSIGN_OR_RETURN(auto result_literal, evaluator.Evaluate(*module, {}));

  // Since the result layout is non-effective to the Evaluator results, explicit
  // relayout here.
  //
  // TODO(b/77824332): Make HloEvaluator take care of the re-layout.
  if (output_layout.has_value()) {
    result_literal = result_literal.Relayout(*output_layout);
  }
  *result->mutable_literal() = result_literal.ToProto();

  return Status::OK();
}

Status Service::GetShape(const GetShapeRequest* arg, GetShapeResponse* result) {
  TF_ASSIGN_OR_RETURN(const ShapedBuffer* buffer,
                      allocation_tracker_.ResolveForReplica(arg->data(), 0));
  *result->mutable_shape() = buffer->on_host_shape().ToProto();
  return Status::OK();
}

Status Service::GetComputationGraphStats(
    const ComputationGraphStatsRequest* arg, ComputationStatsResponse* result) {
  if (!arg->has_computation()) {
    return InvalidArgument("Computations may not be empty.");
  }
  if (!arg->computation().has_host_program_shape()) {
    return InvalidArgument("Program shape may not be empty.");
  }

  HloModuleConfig config(ProgramShape{arg->computation().host_program_shape()});
  config.set_debug_options(arg->debug_options());
  TF_ASSIGN_OR_RETURN(std::unique_ptr<HloModule> module,
                      CreateModuleFromProto(arg->computation(), config));
  DumpHloModuleIfEnabled(*module, kBeforeOptimizationsDumpName);

  // Run HLO analysis to get the computation statistics.
  HloCostAnalysis analysis(
      execute_backend_->compiler()->ShapeSizeBytesFunction());

  TF_RETURN_IF_ERROR(module->entry_computation()->Accept(&analysis));

  ComputationStats stats;
  stats.set_flop_count(analysis.flop_count());
  stats.set_transcendental_count(analysis.transcendental_count());
  *result->mutable_stats() = stats;
  return Status::OK();
}

DeviceHandle Service::SingleComputationDeviceHandle() const {
  DeviceHandle device_handle;
  device_handle.set_handle(0);
  device_handle.set_device_count(1);
  return device_handle;
}

StatusOr<std::vector<se::StreamExecutor*>> Service::Replicas(
    const Backend& backend, const DeviceHandle& device_handle) const {
  std::vector<se::StreamExecutor*> replicas;
  for (int replica = 0; replica < options_.number_of_replicas(); ++replica) {
    // From the computation placer, find out the device ids of the replicas for
    // the given device handle.
    TF_ASSIGN_OR_RETURN(
        int device_ordinal,
        backend.computation_placer()->DeviceId(replica, device_handle.handle(),
                                               options_.number_of_replicas(),
                                               device_handle.device_count()));
    TF_ASSIGN_OR_RETURN(auto executor, backend.stream_executor(device_ordinal));
    replicas.push_back(executor);
  }
  return replicas;
}

}  // namespace xla

redpajama_set_name: RedPajamaGithub